From 6511afff053bab1e7e0542119ff1331813ea19e2 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 1 Nov 2016 13:29:19 +0100 Subject: boot: Quote arguments containing spaces. * boot/boot.c (boot_script_exec_cmd): Quote arguments containing spaces. --- boot/boot.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'boot/boot.c') 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); -- cgit v1.2.3