chiark
/
gitweb
/
~ian
/
secnet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e25a7f
)
pubkeys: Better debug logging for syntax errors
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 23 Nov 2019 17:46:39 +0000
(17:46 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 13:15:49 +0000
(13:15 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
pubkeys.fl.pl
patch
|
blob
|
history
diff --git
a/pubkeys.fl.pl
b/pubkeys.fl.pl
index 69cc3c925aee2ab249529d32d631c5cfb4f8f399..43df2e16593cff2bfeda6ae9cec81cbd2d2c71bf 100755
(executable)
--- 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];
<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"); }