diff options
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/lexer.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libbuild2/lexer.cxx b/libbuild2/lexer.cxx index f445d4b..992e5d1 100644 --- a/libbuild2/lexer.cxx +++ b/libbuild2/lexer.cxx @@ -989,7 +989,7 @@ namespace build2 if ((c = peek ()) == '\\') { get (); - if ((c = peek ()) == '\n') + if ((c = peek ()) == '\n' || eos (c)) return true; } @@ -1000,15 +1000,16 @@ namespace build2 { // Scan until we see the closing one. // - for (; !eos (c); c = peek ()) + for (;;) { - get (); if (c == '#' && ml ()) break; - } - if (eos (c)) - fail (c) << "unterminated multi-line comment"; + if (eos (c = peek ())) + fail (c) << "unterminated multi-line comment"; + + get (); + } } else { |