mirror of
https://github.com/troglobit/finit.git
synced 2026-10-06 07:43:43 +07:00
initctl: Fix 'cond dump/set/clear' commands, only show worked
This patch fixes an invalid use of strpbrk() causing all cond sub-commands, except initctl cond show, to fail. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
+6
-7
@@ -337,14 +337,13 @@ static int do_cond(char *cmd)
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
arg = strpbrk(cmd, " ");
|
||||
if (arg) {
|
||||
*arg = 0;
|
||||
arg = strpbrk(cmd, " \0");
|
||||
if (arg)
|
||||
*arg++ = 0;
|
||||
|
||||
for (c = 0; command[c].cmd; c++) {
|
||||
if (!strcmp(command[c].cmd, cmd))
|
||||
return command[c].cb(arg);
|
||||
}
|
||||
for (c = 0; command[c].cmd; c++) {
|
||||
if (!strcmp(command[c].cmd, cmd))
|
||||
return command[c].cb(arg);
|
||||
}
|
||||
|
||||
return do_cond_show(NULL);
|
||||
|
||||
Reference in New Issue
Block a user