diff options
Diffstat (limited to 'dev-util/perf/files')
| -rw-r--r-- | dev-util/perf/files/perf-6.18-subcmd.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dev-util/perf/files/perf-6.18-subcmd.patch b/dev-util/perf/files/perf-6.18-subcmd.patch new file mode 100644 index 000000000000..e3e067efdd07 --- /dev/null +++ b/dev-util/perf/files/perf-6.18-subcmd.patch @@ -0,0 +1,27 @@ +Fix for --help command when no commands are excluded. + +Link: https://lore.kernel.org/lkml/20251202213632.2873731-1-sjayaram@akamai.com/ + +See also: https://lore.kernel.org/lkml/aTXQw9dtP5df7LmP@gentoo.org/ + +--- 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); +-- |
