Skip to content

Commit

Permalink
Merge pull request universal-ctags#3961 from masatake/markdown--yaml-…
Browse files Browse the repository at this point in the history
…frontmatter-fix-for-empty-input

FrontMatter: fix the carsh for an empty input
  • Loading branch information
masatake authored Mar 19, 2024
2 parents 7b085e7 + b546290 commit 9f337e0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Units/parser-markdown.r/empty-frontmatter.d/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a crash test.
The input is taken from linux-5.14.0-362.8.1.el9.x86_64/redhat/rhdocs/content/docs/_index.md .
3 changes: 3 additions & 0 deletions Units/parser-markdown.r/empty-frontmatter.d/args.ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--extras=*
--fields=*
--kinds-all=*
1 change: 1 addition & 0 deletions Units/parser-markdown.r/empty-frontmatter.d/features
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yaml
3 changes: 3 additions & 0 deletions Units/parser-markdown.r/empty-frontmatter.d/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
---
{{< toc-tree >}}
2 changes: 1 addition & 1 deletion parsers/frontmatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ static void findFrontMatterTags (void)
if (strcmp("---", (const char *)line) == 0)
{
line = readLineFromInputFile ();
unsigned long endOffset = strlen((const char *)line);
if (line)
{
unsigned long endOffset = strlen((const char *)line);
long startLineNum = getInputLineNumber ();
while ((line = readLineFromInputFile()))
endOffset = strlen((const char *)line);
Expand Down

0 comments on commit 9f337e0

Please sign in to comment.