mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 16:34:45 +07:00
helpers.c: Fix run() argparser, assumed all commands have args.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user