From d1a6fa810ef41484dcf67c1f01d9ea2a1ba319e4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 4 Aug 1999 07:54:34 +0000 Subject: [PATCH] o Remove some unnecessary backslashes o collapse multiple !'s by using !+ and checking if yyleng is even or odd. this allows us to simplify ! handling in parse.yacc --- parse.lex | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/parse.lex b/parse.lex index cede10671..221ce413b 100644 --- a/parse.lex +++ b/parse.lex @@ -139,13 +139,14 @@ WORD [[:alnum:]_-]+ sawspace = FALSE; } /* a command line arg */ -\, { +, { LEXTRACE(", "); return(','); } /* return ',' */ -\! { - return('!'); /* return '!' */ +!+ { + if (yyleng % 2 == 1) + return('!'); /* return '!' */ } = { @@ -244,9 +245,10 @@ PASSWD[[:blank:]]*: { if (strcmp(yytext, "ALL") == 0) { LEXTRACE("ALL "); return(ALL); + } else { + LEXTRACE("ALIAS "); + return(ALIAS); } - LEXTRACE("ALIAS "); - return(ALIAS); } [[:alnum:]][[:alnum:]_-]* { -- 2.40.0