Return an error status (127) from the builtins 'type' and 'command' (with

either -v or -V) if a file with a slash in the name doesn't exist (if there is
no slash we already did that).

Additionally, suppress the error message for command -v for files with a slash.

PR:		107674
Submitted by:	Martin Kammerhofer
This commit is contained in:
Stefan Farfeleder 2007-01-11 00:19:00 +00:00
parent b31e373bf7
commit f30842ba79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165930

View File

@ -785,9 +785,12 @@ typecmd_impl(int argc, char **argv, int cmd)
out1fmt("%s\n", argv[i]);
else
out1fmt(" is %s\n", argv[i]);
} else {
if (cmd != TYPECMD_SMALLV)
out1fmt(": %s\n",
strerror(errno));
error |= 127;
}
else
out1fmt(": %s\n", strerror(errno));
}
break;
}