diff options
author | tb <tb@cvs.openbsd.org> | 2016-03-21 13:35:01 +0000 |
---|---|---|
committer | tb <tb@cvs.openbsd.org> | 2016-03-21 13:35:01 +0000 |
commit | 6812a0d79be216cf7e477c5bf4ef68de11fed6e6 (patch) | |
tree | f8c5ad837f76be1ff8588094103b17ee4630e0bf /regress/bin/ksh/version.t | |
parent | b035e3d07c38fac27521c14f1565c4dc21ba3de4 (diff) |
More ksh POSIX compliance fixes by Martijn Dekker:
This simple patch makes the 'command' builtin POSIX-compliant and
consistent with other current shells. It fixes two things:
a) 'command -v' does not find shell reserved words (a.k.a. keywords).
For instance, 'command -v select' outputs nothing but should output
'select'.
b) 'command -pv' always outputs the path of an external command, even
if 'command -p' would execute a builtin. For instance, 'command -p kill'
executes the 'kill' builtin, as expected, but 'command -pv kill' outputs
'/bin/kill'. The '-v' option is supposed to reflect what would actually
be executed, so 'command -pv kill' should output 'kill'. The -p option
sets the PATH to a default system value before doing the search, but
that has no bearing on the fact that builtins take precedence over
external commands.
The patch fixes both issues for 'command' without affecting the
behaviour of the ksh-specific builtin 'whence', which is handled by the
same C function.
Regression test added to obsd-regress.t.
Issues found and fixed by Martijn Dekker, ok millert@
Diffstat (limited to 'regress/bin/ksh/version.t')
0 files changed, 0 insertions, 0 deletions