diff options
author | Kirill Simonov <xi@resolvent.net> | 2006-12-11 19:20:29 +0000 |
---|---|---|
committer | Kirill Simonov <xi@resolvent.net> | 2006-12-11 19:20:29 +0000 |
commit | a5dab4db21662e6be49cb91a55d2425071fa74fe (patch) | |
tree | 0f8ef1c3760ea66babe76df9540a9ff729b57b7c | |
parent | 2ef0340f88d9e32e564cc40a77346988b2127834 (diff) | |
download | libyaml-git-a5dab4db21662e6be49cb91a55d2425071fa74fe.tar.gz |
Force a new line at the end of the input stream even if there are no a new line character. This fixes a nasty bug when libyaml hangs on documents like `[[[[`. Thanks ciaranm for reporting the bug.
-rw-r--r-- | src/scanner.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/scanner.c b/src/scanner.c index 1414401..b190c7e 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -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)) |