]> err.no Git - systemd/commitdiff
util_run_program(): skip multiple spaces in argv creation
authorKay Sievers <kay.sievers@vrfy.org>
Mon, 7 Sep 2009 10:12:55 +0000 (12:12 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Mon, 7 Sep 2009 10:13:50 +0000 (12:13 +0200)
libudev/libudev-util-private.c

index dfde5a998d3413109239eb93cf77e0bf006eaed2..fb64c13229cfdb384c84ff8d51e4bdbd3bff2c0f 100644 (file)
@@ -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++;