2009-06-15 Vladimir Serbinenko <phcoder@gmail.com>
Fix handling of string like \"hello\" and "a b" * script/sh/lexer.c (grub_script_yylex): fix parsing of quoting, escaping and newline
This commit is contained in:
parent
70b7f9fd57
commit
3148bc1cbd
1 changed files with 5 additions and 3 deletions
|
@ -156,18 +156,20 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate)
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;! state->done && (*state->script || firstrun); firstrun = 0)
|
for (;! state->done; firstrun = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (! *state->script)
|
if (! *state->script)
|
||||||
{
|
{
|
||||||
/* Check if more tokens are requested by the parser. */
|
/* Check if more tokens are requested by the parser. */
|
||||||
if (((state->refs && ! parsestate->err)
|
if (((state->refs && ! parsestate->err)
|
||||||
|| state->state == GRUB_PARSER_STATE_ESC)
|
|| state->state == GRUB_PARSER_STATE_ESC
|
||||||
|
|| state->state == GRUB_PARSER_STATE_QUOTE
|
||||||
|
|| state->state == GRUB_PARSER_STATE_DQUOTE)
|
||||||
&& state->getline)
|
&& state->getline)
|
||||||
{
|
{
|
||||||
int doexit = 0;
|
int doexit = 0;
|
||||||
while (!state->script || ! grub_strlen (state->script))
|
while (!state->script || ! *state->script)
|
||||||
{
|
{
|
||||||
grub_free (state->newscript);
|
grub_free (state->newscript);
|
||||||
state->newscript = 0;
|
state->newscript = 0;
|
||||||
|
|
Loading…
Reference in a new issue