util_run_program(): skip multiple spaces in argv creation

This commit is contained in:
Kay Sievers
2009-09-07 12:12:55 +02:00
parent d412a68573
commit f55083ce34

View File

@@ -269,10 +269,14 @@ int util_run_program(struct udev *udev, const char *command, char **envp,
/* do not separate quotes */
pos++;
argv[i] = strsep(&pos, "\'");
while (pos != NULL && pos[0] == ' ')
pos++;
if (pos != NULL)
while (pos[0] == ' ')
pos++;
} else {
argv[i] = strsep(&pos, " ");
if (pos != NULL)
while (pos[0] == ' ')
pos++;
}
dbg(udev, "arg[%i] '%s'\n", i, argv[i]);
i++;