scanner: don't warn about unexpected characters when the char is \0
authorStefan Kost <ensonic@users.sf.net>
Fri, 4 Dec 2009 16:33:22 +0000 (18:33 +0200)
committerStefan Kost <ensonic@users.sf.net>
Fri, 4 Dec 2009 21:01:32 +0000 (23:01 +0200)
giscanner/scannerlexer.l

index 3d9aa33..d78de90 100644 (file)
@@ -190,7 +190,7 @@ stringtext                          ([^\\\"])|(\\.)
 "\""{stringtext}*"\""                  { return STRING; }
 "L\""{stringtext}*"\""                 { return STRING; }
 
-.                                      { fprintf(stderr, "%s:%d: unexpected character `%c'\n", scanner->current_filename, lineno, yytext[0]); }
+.                                      { if (yytext[0]) fprintf(stderr, "%s:%d: unexpected character `%c'\n", scanner->current_filename, lineno, yytext[0]); }
 
 %%