Re: [PATCH] 'command -v' does not find reserved words

2015-07-05 Thread Thorsten Glaser
Martijn Dekker dixit:

The one-line change in the patch below fixes it, to the best of my

I think so too. Applied, plus manpage updated.

bye,
//mirabilos
-- 
  Using Lynx is like wearing a really good pair of shades: cuts out
   the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL.
 -- Henry Nelson, March 1999


[PATCH] 'command -v' does not find reserved words

2015-06-30 Thread Martijn Dekker
Hi,

The one-line change in the patch below fixes it, to the best of my
knowledge. 'command' is handled by the c_whence() function. The problem
was in the conversion of 'command' flags to 'whence' behaviour. Shell
keyword (a.k.a. reserved word) search was unjustly limited to only
'whence' or 'command -V', with 'command -v' excluded.

Thanks,

- M.

--- mksh.orig/funcs.c   2015-04-19 21:18:41.0 +0200
+++ mksh/funcs.c2015-06-30 23:59:19.0 +0200
@@ -538,7 +538,7 @@
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));