helpers.c: Fix run() argparser, assumed all commands have args.

This commit is contained in:
Joachim Nilsson
2013-05-19 18:00:31 +02:00
parent 6518c2d246
commit b212babc87
+2 -2
View File
@@ -368,7 +368,7 @@ int run(char *cmd)
/* Split command line into tokens of an argv[] array. */
args[i++] = strsep(&arg, "\t ");
do {
while (arg && i < NUM_ARGS) {
/* Handle run("su -c \"dbus-daemon --system\" messagebus");
* => "su", "-c", "\"dbus-daemon --system\"", "messagebus" */
if (*arg == '\'' || *arg == '"') {
@@ -383,7 +383,7 @@ int run(char *cmd)
} else {
args[i++] = strsep(&arg, "\t ");
}
} while (arg && i < NUM_ARGS);
}
args[i] = NULL;
#if 0
_e("Splitting: '%s' =>", cmd);