dev-util/perf: apply fix for --help option and help command

Signed-off-by: Guilherme Amadio <amadio@gentoo.org>
This commit is contained in:
Guilherme Amadio 2025-12-10 13:08:22 +01:00
parent 399bcdd904
commit a77ba80e01
No known key found for this signature in database
GPG Key ID: 163F3352A3B4F9FB
2 changed files with 28 additions and 0 deletions

View File

@ -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);
--

View File

@ -177,6 +177,7 @@ src_prepare() {
pushd "${S_K}" >/dev/null || die
# Gentoo patches go here
eapply "${FILESDIR}/${P}-subcmd.patch"
popd || die
# Drop some upstream too-developer-oriented flags and fix the