summaryrefslogtreecommitdiffstats
path: root/discover/grub2-parser.c
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2013-05-17 14:28:45 +0800
committerGeoff Levand <geoff@infradead.org>2013-05-17 17:43:54 +0800
commitc019c1cea9c12aff4aa945414bb2841d085d5b10 (patch)
treefbe852ff0e272a320aebe087d411cf2268a78e52 /discover/grub2-parser.c
parent651e0c19b505aad965b2f7988c1bf7a067d93c0d (diff)
downloadtalos-petitboot-c019c1cea9c12aff4aa945414bb2841d085d5b10.tar.gz
talos-petitboot-c019c1cea9c12aff4aa945414bb2841d085d5b10.zip
parser/grub2: Better menuentry parsing
Grub2 menuentry entry text can use double or single quotes. Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'discover/grub2-parser.c')
-rw-r--r--discover/grub2-parser.c7
1 files changed, 1 insertions, 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);
OpenPOWER on IntegriCloud