From c19daa69bc15e73b7ebf79d5280ba62c86c20b6f Mon Sep 17 00:00:00 2001 From: Alan Dunn Date: Wed, 2 Mar 2016 08:59:02 -0800 Subject: discover/grub2: Fix handling of positional parameters Positional parameters are set in the environment with '$' prepended to the name. This causes lookups to fail because parameter lookups don't include the '$'. TESTED: Added a test that covers positional parameters in GRUB2 parser. Build succeeds, tests pass. Bootstrapped-by: Nancy Yuen Signed-off-by: Alan Dunn Signed-off-by: Sam Mendoza-Jonas --- discover/grub2/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'discover') diff --git a/discover/grub2/script.c b/discover/grub2/script.c index f521681..48c963e 100644 --- a/discover/grub2/script.c +++ b/discover/grub2/script.c @@ -380,7 +380,7 @@ static int function_invoke(struct grub2_script *script, /* set positional parameters */ for (i = 0; i < argc; i++) { - name = talloc_asprintf(script, "$%d", i); + name = talloc_asprintf(script, "%d", i); script_env_set(script, name, argv[i]); } -- cgit v1.2.1