From: Ian Jackson Date: Sat, 23 Nov 2019 17:46:39 +0000 (+0000) Subject: pubkeys: Better debug logging for syntax errors X-Git-Tag: v0.6.0~186 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=secnet.git;a=commitdiff_plain;h=0f8f332557cf678d4f895e3ec7b60fbf0adaeee7 pubkeys: Better debug logging for syntax errors Signed-off-by: Ian Jackson --- diff --git a/pubkeys.fl.pl b/pubkeys.fl.pl index 69cc3c9..43df2e1 100755 --- a/pubkeys.fl.pl +++ b/pubkeys.fl.pl @@ -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]; <> { return 0; } -<*>. { FAIL("syntax error"); } +<*>. { + yymore(); + BEGIN(SYNTAXERR); +} +.* { + slilog(LI,M_DEBUG,"pubkeys syntax error at `%s'", yytext); + FAIL("syntax error"); +} <*>\n { FAIL("syntax error - unexpected newline"); } <> { FAIL("syntax error - unexpected eof"); }