From c019c1cea9c12aff4aa945414bb2841d085d5b10 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Fri, 17 May 2013 14:28:45 +0800 Subject: [PATCH] parser/grub2: Better menuentry parsing Grub2 menuentry entry text can use double or single quotes. Signed-off-by: Geoff Levand --- discover/grub2-parser.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/discover/grub2-parser.c b/discover/grub2-parser.c index a2308ee..bd08ec0 100644 --- a/discover/grub2-parser.c +++ b/discover/grub2-parser.c @@ -141,8 +141,6 @@ static void grub2_process_pair(struct conf_context *conf, const char *name, return; if (streq(name, "menuentry")) { - char *sep; - /* complete any existing option... */ if (state->opt) grub2_finish(conf); @@ -151,10 +149,7 @@ static void grub2_process_pair(struct conf_context *conf, const char *name, opt = discover_boot_option_create(conf->dc, conf->dc->device); opt->option->boot_args = talloc_strdup(opt->option, ""); - sep = strchr(value, '\''); - - if (sep) - *sep = 0; + value = strtok(value, "\'{\""); opt->option->id = talloc_asprintf(opt->option, "%s#%s", dev->id, value); -- 2.39.2