summaryrefslogtreecommitdiff
path: root/tools/lib/subcmd/help.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-04 07:24:37 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-04 07:25:12 -0500
commit2c8fedbbbb8266b792c1bfec0dbcbed77d61fa8d (patch)
treeddd97d859c2b7440f5a69f219d553adf814d20b8 /tools/lib/subcmd/help.c
parent0c87214ec2d8da6478321a9e5b4c1e1f81fbf861 (diff)
parent6258e292d7463f96d0f06dff2a39093a54c9d16f (diff)
Merge v6.18.16
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/subcmd/help.c')
-rw-r--r--tools/lib/subcmd/help.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
index ddaeb4eb3e24..db94aa685b73 100644
--- a/tools/lib/subcmd/help.c
+++ b/tools/lib/subcmd/help.c
@@ -97,11 +97,13 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
ei++;
}
}
- if (ci != cj) {
- while (ci < cmds->cnt) {
- cmds->names[cj++] = cmds->names[ci];
- cmds->names[ci++] = NULL;
+ while (ci < cmds->cnt) {
+ if (ci != cj) {
+ cmds->names[cj] = cmds->names[ci];
+ cmds->names[ci] = NULL;
}
+ ci++;
+ cj++;
}
for (ci = cj; ci < cmds->cnt; ci++)
assert(cmds->names[ci] == NULL);