diff --git a/ChangeLog b/ChangeLog index c52567083..716026e1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-06-02 Vladimir Serbinenko + + * grub-core/kern/parser.c (grub_parser_state_transitions): Handle \t. + (grub_parser_cmdline_state): Likewise. + (grub_parser_split_cmdline): Likewise. + 2012-06-02 Vladimir Serbinenko * util/getroot.c (grub_guess_root_devices): Don't canonicalise diff --git a/grub-core/kern/parser.c b/grub-core/kern/parser.c index 5b449586c..9213caa76 100644 --- a/grub-core/kern/parser.c +++ b/grub-core/kern/parser.c @@ -42,12 +42,14 @@ static struct grub_parser_state_transition state_transitions[] = { {GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME2, '{', 0}, {GRUB_PARSER_STATE_VAR, GRUB_PARSER_STATE_VARNAME, 0, 1}, {GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1}, + {GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, '\t', 1}, {GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0}, {GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME2, '{', 0}, {GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME, 0, 1}, {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_TEXT, '\"', 0}, {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, ' ', 1}, + {GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, '\t', 1}, {GRUB_PARSER_STATE_QVARNAME2, GRUB_PARSER_STATE_DQUOTE, '}', 0}, {0, 0, 0, 0} @@ -73,7 +75,7 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) if (transition->input == c) break; - if (transition->input == ' ' && !grub_isalpha (c) + if (grub_isspace (transition->input) && !grub_isalpha (c) && !grub_isdigit (c) && c != '_') break; @@ -175,7 +177,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline, else { if (newstate == GRUB_PARSER_STATE_TEXT - && state != GRUB_PARSER_STATE_ESC && use == ' ') + && state != GRUB_PARSER_STATE_ESC && grub_isspace (use)) { /* Don't add more than one argument if multiple spaces are used. */