1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-11-01 00:51:08 +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) { if (strchr(arg, ' ') != NULL) {
char *pos = arg; char *pos = arg;
while (pos != NULL) { while (pos != NULL && pos[0] != '\0') {
if (pos[0] == '\'') { if (pos[0] == '\'') {
/* don't separate if in apostrophes */ /* do not separate quotes */
pos++; pos++;
argv[i] = strsep(&pos, "\'"); argv[i] = strsep(&pos, "\'");
while (pos != NULL && pos[0] == ' ') while (pos != NULL && pos[0] == ' ')