File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -952,8 +952,11 @@ static void forkexec(char *const argv[], const ups_t *ups)
952952
953953 /* the command line is made of the driver name followed by args */
954954 if (strstr (argv [0 ], ups -> driver )) {
955- /* We already know whom to call (got a pointer to needle in the haystack) */
956- snprintf (commandline , sizeof (commandline ), "%s" , argv [0 ]);
955+ /* We already know whom to call (got a pointer
956+ * to needle in the haystack); that path may
957+ * have spaces ("Program Files") so quoted.
958+ */
959+ snprintf (commandline , sizeof (commandline ), "\"%s\"" , argv [0 ]);
957960 } else {
958961 /* Hope for the PATH based resolution to work, perhaps the
959962 * driver program is located nearby (depends on configure
@@ -966,6 +969,7 @@ static void forkexec(char *const argv[], const ups_t *ups)
966969 }
967970
968971 while (argv [i ] != NULL ) {
972+ /* TOTHINK: No known toxic spaces to quote here... */
969973 snprintfcat (commandline , sizeof (commandline ), " %s" , argv [i ]);
970974 i ++ ;
971975 }
You can’t perform that action at this time.
0 commit comments