OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-771-gc162c62
Gerrit Code Review
gerrit@openafs.org
Fri, 6 Nov 2026 16:30:39 -0500
The following commit has been merged in the master branch:
commit c162c62569febdcc9811fbc404d4210315654e0d
Author: Michael Meffie <mmeffie@sinenomine.net>
Date: Wed Oct 7 17:00:38 2026 -0400
cmd: Allow parameter aliases longer than the parameter name
FindType() skips any parameter whose name is shorter than the given
switch before it checks that parameter's aliases. As a result, an alias
which is longer than the parameter name it is attached to is never
matched, and the switch is reported as unrecognized.
For example, with:
cmd_AddParmAtOffset(as, OPT_foo, "-host", ...);
cmd_AddParmAlias(as, OPT_foo, "-server");
the option "-server" is not recognized during cmd_Parse().
Fortunately, existing callers are not affected because their aliases are
shorter than than the parameter names.
The length check is not needed, since strncmp() cannot match an
abbreviation when the parameter name is shorter than the given option
name.
This length check has been present, but not needed, since OpenAFS 1.0,
so just remove the unneeded check.
Also add a test for an alias that is longer than the parameter name.
Change-Id: I33293db34dfa90f34e44632c0bf93ff6e309f579
Assisted-by: Claude:claude-opus-5-5
Reviewed-on: https://gerrit.openafs.org/17023
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
src/cmd/cmd.c | 2 --
tests/cmd/command-t.c | 22 +++++++++++++++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
--
OpenAFS Master Repository