diff options
author | fenner <fenner@FreeBSD.org> | 2001-11-07 00:05:26 +0000 |
---|---|---|
committer | fenner <fenner@FreeBSD.org> | 2001-11-07 00:05:26 +0000 |
commit | a53b61e772f8606cd8a338c0298ccd3691135569 (patch) | |
tree | c6d3c8b17339540bc682d3596b3963c9c6fa8e95 /lib | |
parent | 140b89bb7704684c4efa5162eb0fdde1adcf3c2c (diff) | |
download | FreeBSD-src-a53b61e772f8606cd8a338c0298ccd3691135569.zip FreeBSD-src-a53b61e772f8606cd8a338c0298ccd3691135569.tar.gz |
Don't ignore unknown characters. The previous code treated a line like:
hosts:!!!!!!!!@@@@@$%^&*()()*$(files{}{}|||++!)(dns
exactly the same as:
hosts: files dns
Recover from parse errors by looking for the end of a line; this
allows entries without errors to still be parsed even if there is
an erroneous entry earlier in the file.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/nslexer.l | 4 | ||||
-rw-r--r-- | lib/libc/net/nsparser.y | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/net/nslexer.l b/lib/libc/net/nslexer.l index 104cfbb..1166eed 100644 --- a/lib/libc/net/nslexer.l +++ b/lib/libc/net/nslexer.l @@ -94,9 +94,7 @@ STRING [a-zA-Z][a-zA-Z0-9_]* return STRING; } -[:=\[\]] return yytext[0]; - -. ; /* ignore all else */ +. return yytext[0]; %% diff --git a/lib/libc/net/nsparser.y b/lib/libc/net/nsparser.y index b39f011..79d5185 100644 --- a/lib/libc/net/nsparser.y +++ b/lib/libc/net/nsparser.y @@ -87,6 +87,10 @@ Entry { _nsdbtput(&curdbt); } + | error NL + { + yyerrok; + } ; Database |