some bug fixes

This commit is contained in:
BVK Chaitanya 2010-01-23 10:14:32 +05:30
parent 836727564e
commit 1a0c3b4809
2 changed files with 4 additions and 4 deletions

View file

@ -139,7 +139,7 @@ append_newline (const char *src)
grub_size_t len;
len = grub_strlen (src);
line = grub_malloc (len + 1);
line = grub_malloc (len + 2);
if (!line)
return 0;

View file

@ -128,13 +128,13 @@ typedef grub_size_t yy_size_t;
BLANK [ \t]
COMMENT ^[ \t]*#.*$
CHAR [^|&;()<> \t\n\'\"]
CHAR [^|&$;()<> \t\n\'\"\\]
DIGITS [[:digit:]]+
NAME [[:alpha:]_][[:alnum:][:digit:]_]*
ESC \\.
VARIABLE ${NAME}|$\{{NAME}\}|${DIGITS}|$\{{DIGITS}\}|$\?|$\{\?\}
DQSTR \"([^\"]|\\\")*\"
DQSTR \"([^\\\"]|{ESC})*\"
SQSTR \'[^\']*\'
WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
@ -190,6 +190,7 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
{WORD} {
RECORD;
/* resplit yytext */
grub_dprintf ("lexer", "word: [%s]\n", yytext);
yypush_buffer_state (YY_CURRENT_BUFFER, yyscanner);
if (yy_scan_string (yytext, yyscanner))
{
@ -209,7 +210,6 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
return GRUB_PARSER_TOKEN_BAD;
}
/* Split word into multiple args */
<SPLIT>{