summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-11-01 13:29:19 +0100
committerJustus Winter <justus@gnupg.org>2016-11-01 15:18:19 +0100
commit6511afff053bab1e7e0542119ff1331813ea19e2 (patch)
treee392faacde3db96403f9d607938a69b21672bedc /boot
parentdfd5134090dd80957dce5a65b467aafaff47ca3b (diff)
boot: Quote arguments containing spaces.
* boot/boot.c (boot_script_exec_cmd): Quote arguments containing spaces.
Diffstat (limited to 'boot')
-rw-r--r--boot/boot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/boot/boot.c b/boot/boot.c
index dacf9650..234ccd8b 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -318,8 +318,13 @@ boot_script_exec_cmd (void *hook,
write (2, path, strlen (path));
for (i = 1; i < argc; ++i)
{
+ int quote = !! index (argv[i], ' ') || !! index (argv[i], '\t');
write (2, " ", 1);
+ if (quote)
+ write (2, "\"", 1);
write (2, argv[i], strlen (argv[i]));
+ if (quote)
+ write (2, "\"", 1);
}
write (2, "\r\n", 2);