mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-31 16:21:11 +03:00
run_program: prevent empty last argv entry
This commit is contained in:
parent
be7f7f5701
commit
c28c4486af
@ -138,9 +138,9 @@ static int run_program(struct udev_device *dev, const char *command,
|
||||
if (strchr(arg, ' ') != NULL) {
|
||||
char *pos = arg;
|
||||
|
||||
while (pos != NULL) {
|
||||
while (pos != NULL && pos[0] != '\0') {
|
||||
if (pos[0] == '\'') {
|
||||
/* don't separate if in apostrophes */
|
||||
/* do not separate quotes */
|
||||
pos++;
|
||||
argv[i] = strsep(&pos, "\'");
|
||||
while (pos != NULL && pos[0] == ' ')
|
||||
|
Loading…
Reference in New Issue
Block a user