mirror of
https://github.com/troglobit/finit.git
synced 2026-11-15 19:13:11 +00:00
initctl.c: change string_match to string_compare
It should not use relaxed comparison in some places, otherwise it mess up with scenarios like: ``` $ initctl status ntpdpre $ initctl status ntpd ``` the output might be same for both of the above commands without this fix. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
1 parent
f930953e6a
commit
e51587c66e
1 file changed
+3
-3
+3
-3
@@ -722,7 +722,7 @@ static int show_status(char *arg)
|
|||||||
|
|
||||||
for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) {
|
for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) {
|
||||||
svc_ident(svc, ident, sizeof(ident));
|
svc_ident(svc, ident, sizeof(ident));
|
||||||
if (string_match(ident, arg))
|
if (string_compare(ident, arg))
|
||||||
num++;
|
num++;
|
||||||
if (string_case_compare(ident, arg))
|
if (string_case_compare(ident, arg))
|
||||||
exact++;
|
exact++;
|
||||||
@@ -797,7 +797,7 @@ static int show_status(char *arg)
|
|||||||
char *lvls;
|
char *lvls;
|
||||||
|
|
||||||
svc_ident(svc, ident, sizeof(ident));
|
svc_ident(svc, ident, sizeof(ident));
|
||||||
if (num && !string_match(ident, arg))
|
if (num && !string_compare(ident, arg))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
printf("%-*d ", pw, svc->pid);
|
printf("%-*d ", pw, svc->pid);
|
||||||
@@ -995,7 +995,7 @@ static int cmd_parse(int argc, char *argv[], struct cmd *command)
|
|||||||
if (!cmd_cond(&command[i]))
|
if (!cmd_cond(&command[i]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!string_match(command[i].cmd, argv[0]))
|
if (!string_compare(command[i].cmd, argv[0]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (command[i].ctx)
|
if (command[i].ctx)
|
||||||
|
|||||||
Reference in new issue
Block a user