mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
helpers.c: Fix run() argparser, assumed all commands have args.
This commit is contained in:
1 parent
6518c2d246
commit
b212babc87
1 file changed
+2
-2
@@ -368,7 +368,7 @@ int run(char *cmd)
|
|||||||
|
|
||||||
/* Split command line into tokens of an argv[] array. */
|
/* Split command line into tokens of an argv[] array. */
|
||||||
args[i++] = strsep(&arg, "\t ");
|
args[i++] = strsep(&arg, "\t ");
|
||||||
do {
|
while (arg && i < NUM_ARGS) {
|
||||||
/* Handle run("su -c \"dbus-daemon --system\" messagebus");
|
/* Handle run("su -c \"dbus-daemon --system\" messagebus");
|
||||||
* => "su", "-c", "\"dbus-daemon --system\"", "messagebus" */
|
* => "su", "-c", "\"dbus-daemon --system\"", "messagebus" */
|
||||||
if (*arg == '\'' || *arg == '"') {
|
if (*arg == '\'' || *arg == '"') {
|
||||||
@@ -383,7 +383,7 @@ int run(char *cmd)
|
|||||||
} else {
|
} else {
|
||||||
args[i++] = strsep(&arg, "\t ");
|
args[i++] = strsep(&arg, "\t ");
|
||||||
}
|
}
|
||||||
} while (arg && i < NUM_ARGS);
|
}
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
#if 0
|
#if 0
|
||||||
_e("Splitting: '%s' =>", cmd);
|
_e("Splitting: '%s' =>", cmd);
|
||||||
|
|||||||
Reference in new issue
Block a user