]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Fix some issues with CTL* bytes and ${var#pat}.
authorJilles Tjoelker <jilles@FreeBSD.org>
Fri, 29 Oct 2010 19:34:57 +0000 (19:34 +0000)
committerJilles Tjoelker <jilles@FreeBSD.org>
Fri, 29 Oct 2010 19:34:57 +0000 (19:34 +0000)
commit60f7eec450c6174dafb47ccd96b247293dbc75c9
treee746f39f7e9cc329381f8a5921f6d37f038dd8dc
parent67fb1bc8edb075b95240d1a3b403882bc37cb14f
sh: Fix some issues with CTL* bytes and ${var#pat}.

subevalvar() incorrectly assumed that CTLESC bytes were present iff the
expansion was quoted. However, they are present iff various processing such
as word splitting is to be done later on.

Example:
  v=@$e@$e@$e@
  y="${v##*"$e"}"
  echo "$y"
failed if $e contained the magic CTLESC byte.

Exp-run done by: pav (with some other sh(1) changes)
bin/sh/expand.c
tools/regression/bin/sh/expansion/trim6.0 [new file with mode: 0644]