mirror of
https://github.com/troglobit/finit.git
synced 2026-10-27 12:20:54 +00: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:
1 parent
83445f1ebe
commit
fd090a6785
1 file changed
+6
-7
+6
-7
@@ -337,14 +337,13 @@ static int do_cond(char *cmd)
|
|||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
arg = strpbrk(cmd, " ");
|
arg = strpbrk(cmd, " \0");
|
||||||
if (arg) {
|
if (arg)
|
||||||
*arg = 0;
|
*arg++ = 0;
|
||||||
|
|
||||||
for (c = 0; command[c].cmd; c++) {
|
for (c = 0; command[c].cmd; c++) {
|
||||||
if (!strcmp(command[c].cmd, cmd))
|
if (!strcmp(command[c].cmd, cmd))
|
||||||
return command[c].cb(arg);
|
return command[c].cb(arg);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return do_cond_show(NULL);
|
return do_cond_show(NULL);
|
||||||
|
|||||||
Reference in new issue
Block a user