Skip to content

Commit

Permalink
Force a new line at the end of the input stream even if there are no …
Browse files Browse the repository at this point in the history
…a new line character. This fixes a nasty bug when libyaml hangs on documents like `[[[[`. Thanks ciaranm for reporting the bug.
  • Loading branch information
xitology committed Dec 11, 2006
1 parent 609cce0 commit c83b67a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,13 @@ yaml_parser_fetch_stream_end(yaml_parser_t *parser)
{
yaml_token_t token;

/* Force new line. */

if (parser->mark.column != 0) {
parser->mark.column = 0;
parser->mark.line ++;
}

/* Reset the indentation level. */

if (!yaml_parser_unroll_indent(parser, -1))
Expand Down

0 comments on commit c83b67a

Please sign in to comment.