fix and testcase for \$ in grub script dquote strings
This commit is contained in:
parent
4b0cd8f813
commit
4e6da157dd
2 changed files with 10 additions and 6 deletions
|
@ -211,7 +211,7 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
|||
ARG (GRUB_SCRIPT_ARG_TYPE_TEXT);
|
||||
}
|
||||
\\ |
|
||||
[^\"\'$\\]+ { COPY (yytext, yyleng); }
|
||||
[^\"\'\$\\]+ { COPY (yytext, yyleng); }
|
||||
<<EOF>> {
|
||||
yy_pop_state (yyscanner);
|
||||
yypop_buffer_state (yyscanner);
|
||||
|
@ -254,6 +254,11 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
|||
}
|
||||
|
||||
<DQUOTE>{
|
||||
\\\$ { COPY ("$", 1); }
|
||||
\\\\ { COPY ("\\", 1); }
|
||||
\\\" { COPY ("\"", 1); }
|
||||
\\\n { /* ignore */ }
|
||||
[^\"\$\\\n]+ { COPY (yytext, yyleng); }
|
||||
\" {
|
||||
yy_pop_state (yyscanner);
|
||||
ARG (GRUB_SCRIPT_ARG_TYPE_DQSTR);
|
||||
|
@ -262,10 +267,6 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
|||
yy_push_state (VAR, yyscanner);
|
||||
ARG (GRUB_SCRIPT_ARG_TYPE_DQSTR);
|
||||
}
|
||||
\\\\ { COPY ("\\", 1); }
|
||||
\\\" { COPY ("\"", 1); }
|
||||
\\\n { /* ignore */ }
|
||||
[^\"$\\\n]+ { COPY (yytext, yyleng); }
|
||||
(.|\n) { COPY (yytext, yyleng); }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue