chiark / gitweb /
pubkeys: Better debug logging for syntax errors
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 17:46:39 +0000 (17:46 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:49 +0000 (21:56 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
pubkeys.fl.pl

index 69cc3c925aee2ab249529d32d631c5cfb4f8f399..43df2e16593cff2bfeda6ae9cec81cbd2d2c71bf 100755 (executable)
@@ -134,6 +134,7 @@ L   [ \t]*
 S      [ \t]+
 BASE91S        []-~!#-&(-[]+
 %x SKIPNL
+%x SYNTAXERR
 
 %option yylineno
 %option noyywrap
@@ -267,7 +268,14 @@ static struct pubkeyset_context c[1];
 
 <INITIAL><<EOF>>       { return 0; }
 
-<*>. { FAIL("syntax error"); }
+<*>. {
+    yymore();
+    BEGIN(SYNTAXERR);
+}
+<SYNTAXERR>.* {
+    slilog(LI,M_DEBUG,"pubkeys syntax error at `%s'", yytext);
+    FAIL("syntax error");
+}
 <*>\n { FAIL("syntax error - unexpected newline"); }
 <<EOF>> { FAIL("syntax error - unexpected eof"); }