From 48af854117ddceeff7711d22b98a69c5de781e18 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 5 Jul 2015 17:50:40 +0000 Subject: [PATCH] fix 'command -v' for "shell reserved words" From: Martijn Dekker also adjust manpage accordingly --- funcs.c | 4 ++-- mksh.1 | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/funcs.c b/funcs.c index 573e9f6..b2b04fb 100644 --- a/funcs.c +++ b/funcs.c @@ -38,7 +38,7 @@ #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 /* @@ -538,7 +538,7 @@ c_whence(const char **wp) uint32_t h = 0; tp = NULL; - if ((iam_whence || vflag) && !pflag) + if (!pflag) tp = ktsearch(&keywords, id, h = hash(id)); if (!tp && !pflag) { tp = ktsearch(&aliases, id, h ? h : hash(id)); diff --git a/mksh.1 b/mksh.1 index 9efdc1e..268b463 100644 --- a/mksh.1 +++ b/mksh.1 @@ -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 $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -3296,9 +3296,9 @@ option is given, instead of executing .Ar cmd , information about what would be executed is given (and the same is done for .Ar arg ... ) . -For special and regular built-in commands and functions, their names are simply -printed; for aliases, a command that defines them is printed; and for commands -found by searching the +For builtins, functions and keywords, their names are simply printed; +for aliases, a command that defines them is printed; +for utilities found by searching the .Ev PATH parameter, the full path of the command is printed. If no command is found