From: Kay Sievers Date: Mon, 7 Sep 2009 10:12:55 +0000 (+0200) Subject: util_run_program(): skip multiple spaces in argv creation X-Git-Tag: 174~785 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f55083ce34c4065a4c87c98e0c77cb4bf70909d0;p=systemd util_run_program(): skip multiple spaces in argv creation --- diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index dfde5a99..fb64c132 100644 --- a/libudev/libudev-util-private.c +++ b/libudev/libudev-util-private.c @@ -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++;