mirror of
https://github.com/systemd/systemd.git
synced 2025-03-25 18:50:18 +03:00
util_run_program(): skip multiple spaces in argv creation
This commit is contained in:
parent
d412a68573
commit
f55083ce34
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user