From: Samanta Navarro Date: Wed, 4 Nov 2020 11:36:00 +0000 (+0000) Subject: whereis: do not ignore trailing numbers X-Git-Tag: v2.37-rc1~396^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d95ee9fd759762ce11b292d5d4484dd62888645e;p=thirdparty%2Futil-linux.git whereis: do not ignore trailing numbers The commands diff and diff3 are so distinct that their manual pages should not be mixed in whereis output. Theoretically this works for commands and binaries with links to each other, e.g. gpg and gpg2, but if gpg is version 1 and gpg2 is version 2 then manual pages do not match either. Also the while loop does not decrement "i" while incrementing "dp". The effect of this is that the output of whereis depends on manual pages being compressed or not. The easiest solution is to not ignore trailing numbers. Signed-off-by: Samanta Navarro --- diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c index 49c7b410f9..e3e480bdc2 100644 --- a/misc-utils/whereis.c +++ b/misc-utils/whereis.c @@ -414,8 +414,6 @@ static int filename_equal(const char *cp, const char *dp) cp++, dp++, i--; if (*cp == 0 && *dp == 0) return 1; - while (isdigit(*dp)) - dp++; if (*cp == 0 && *dp++ == '.') { --i; while (i > 0 && *dp)