fix 'command -v' for "shell reserved words"

From: Martijn Dekker <martijn@inlv.org>

also adjust manpage accordingly
This commit is contained in:
tg 2015-07-05 17:50:40 +00:00
parent 0d5b514e63
commit 48af854117
2 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@
#endif #endif
#endif #endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.274 2015/07/05 14:43:06 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.275 2015/07/05 17:50:39 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
/* /*
@ -538,7 +538,7 @@ c_whence(const char **wp)
uint32_t h = 0; uint32_t h = 0;
tp = NULL; tp = NULL;
if ((iam_whence || vflag) && !pflag) if (!pflag)
tp = ktsearch(&keywords, id, h = hash(id)); tp = ktsearch(&keywords, id, h = hash(id));
if (!tp && !pflag) { if (!tp && !pflag) {
tp = ktsearch(&aliases, id, h ? h : hash(id)); tp = ktsearch(&aliases, id, h ? h : hash(id));

8
mksh.1
View File

@ -1,4 +1,4 @@
.\" $MirOS: src/bin/mksh/mksh.1,v 1.370 2015/07/05 15:45:18 tg Exp $ .\" $MirOS: src/bin/mksh/mksh.1,v 1.371 2015/07/05 17:50:40 tg Exp $
.\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $
.\"- .\"-
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
@ -3296,9 +3296,9 @@ option is given, instead of executing
.Ar cmd , .Ar cmd ,
information about what would be executed is given (and the same is done for information about what would be executed is given (and the same is done for
.Ar arg ... ) . .Ar arg ... ) .
For special and regular built-in commands and functions, their names are simply For builtins, functions and keywords, their names are simply printed;
printed; for aliases, a command that defines them is printed; and for commands for aliases, a command that defines them is printed;
found by searching the for utilities found by searching the
.Ev PATH .Ev PATH
parameter, the full path of the command is printed. parameter, the full path of the command is printed.
If no command is found If no command is found