1
1
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:
Kay Sievers 2008-10-16 21:35:11 +02:00
parent be7f7f5701
commit c28c4486af

View File

@ -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] == ' ')