Bugfix: Correctly handle --no-startup-id with quoted exec commands (Thanks aksr)

Parser changes shortly before a release. What could possibly go wrong.
This commit is contained in:
Michael Stapelberg
2011-11-11 00:28:04 +00:00
parent 41cf2468c0
commit 60bfc3a600
5 changed files with 52 additions and 37 deletions

View File

@ -48,6 +48,8 @@ EOL (\r?\n)
/* handle a quoted string or everything up to the next whitespace */
%s WANT_QSTRING
%x EXEC
%x BUFFER_LINE
%%
@ -101,7 +103,9 @@ back_and_forth { BEGIN(INITIAL); return TOK_BACK_AND_FORTH; }
<EAT_WHITESPACE>[ \t]* { yy_pop_state(); }
[ \t]* { /* ignore whitespace */ ; }
exec { WS_STRING; return TOK_EXEC; }
<EXEC>--no-startup-id { printf("no startup id\n"); yy_pop_state(); return TOK_NO_STARTUP_ID; }
<EXEC>. { printf("anything else: *%s*\n", yytext); yyless(0); yy_pop_state(); yy_pop_state(); }
exec { WS_STRING; yy_push_state(EXEC); yy_push_state(EAT_WHITESPACE); return TOK_EXEC; }
exit { return TOK_EXIT; }
reload { return TOK_RELOAD; }
restart { return TOK_RESTART; }