]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
better handlign of a too early error condition
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 20 Aug 2012 16:14:02 +0000 (18:14 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 20 Aug 2012 16:14:02 +0000 (18:14 +0200)
parser.c

index 4f5b7be4e9594c40b07f63d13954caedab82d552..21a944bdf36c6c8e6d098bcf999bcaf3048a9aae 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2685,12 +2685,17 @@ bool parser_compile(const char *filename)
                 if (parser->tok == TOKEN_EOF)
                     parseerror(parser, "unexpected eof");
                 else if (!parser->errors)
-                    parseerror(parser, "parse error\n");
+                    parseerror(parser, "parse error");
                 lex_close(parser->lex);
                 parser->lex = NULL;
                 return false;
             }
         }
+    } else {
+        parseerror(parser, "parse error");
+        lex_close(parser->lex);
+        parser->lex = NULL;
+        return false;
     }
 
     lex_close(parser->lex);