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


[Bug 1453827] Re: complex substitutions inside complex substitutions (both using ADELIM) read past allocated memory

2015-07-05 Thread Thorsten Glaser
The fix for this is, unfortunately, to rewrite the whole variable
expansion code, which will however have benefits:

• we can get array trimming working in the same go

• we can fix the issue reported by izabera and confirmed by Geoff and
Chet:

tglase@tglase:~ $ ksh93 -c 'a=~/x; echo ${a#~} ${a#\~}'
~/x /x
tglase@tglase:~ $ mksh -c 'a=~/x; echo ${a#~} ${a#\~}'
/x /x

  (this is, tilde expansion is mandated for a couple of expansions' RHS,
like ${x#y} in POSIX and ${x/y} extension which is modelled after it)

-- 
You received this bug notification because you are a member of mksh
Mailing List, which is subscribed to mksh.
Matching subscriptions: mkshlist-to-mksh-bugmail
https://bugs.launchpad.net/bugs/1453827

Title:
  complex substitutions inside complex substitutions (both using ADELIM)
  read past allocated memory

Status in The MirBSD Korn Shell:
  Triaged

Bug description:
  Reproducer:

  valgrind --track-origins=yes --leak-check=no b/mksh -c
  'foo=${bar//baz/${sum:1}}'

  This seems to be a nesting problem. A closing ADELIM omits the CSUBST,
  which also irritates wdscan (which seems flakey anyway), which is what
  the substitution uses.

  Workaround: use temporary variables.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mksh/+bug/1453827/+subscriptions