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 <ferivoz@riseup.net>
This commit is contained in:
parent
b7fc158a2e
commit
d95ee9fd75
|
@ -414,8 +414,6 @@ static int filename_equal(const char *cp, const char *dp)
|
||||||
cp++, dp++, i--;
|
cp++, dp++, i--;
|
||||||
if (*cp == 0 && *dp == 0)
|
if (*cp == 0 && *dp == 0)
|
||||||
return 1;
|
return 1;
|
||||||
while (isdigit(*dp))
|
|
||||||
dp++;
|
|
||||||
if (*cp == 0 && *dp++ == '.') {
|
if (*cp == 0 && *dp++ == '.') {
|
||||||
--i;
|
--i;
|
||||||
while (i > 0 && *dp)
|
while (i > 0 && *dp)
|
||||||
|
|
Loading…
Reference in New Issue