]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
some bug fixes
authorBVK Chaitanya <bvk.groups@gmail.com>
Sat, 23 Jan 2010 04:44:32 +0000 (10:14 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Sat, 23 Jan 2010 04:44:32 +0000 (10:14 +0530)
script/lexer.c
script/yylex.l

index 17c38a353bf9998b14a48233ab8b6485e27f544e..caefdb7a778a83665789b1be043b88865c9197fd 100644 (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;
 
index 9cafba5c29f31b3e848438ad898cca2f0ddb2c23..7cef8496bca9d9e69be0b3511663c49450c8f52b 100644 (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>{