sh: Do not word split "${#parameter}".
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 20 Apr 2011 22:24:54 +0000 (22:24 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 20 Apr 2011 22:24:54 +0000 (22:24 +0000)
commit69a06c6c28e3d58961eb9fae585fa3d09f7fb8a6
tree85bc887cbbe56b0aa0f5700dc4f7350dc2764745
parentd85cf186ab6ffc01f5f4d1b61280869d5e4690d1
sh: Do not word split "${#parameter}".

This is only a problem if IFS contains digits, which is unusual but valid.

Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated
as ${#parameter}. The underlying problem was that "${#parameter}"
erroneously added CTLESC bytes before determining the length. This
was properly fixed for PR bin/56147 but the incorrect fix was not backed
out.

Reported by: Seeker on forums.freebsd.org
MFC after: 2 weeks

git-svn-id: http://svn.freebsd.org/base/head@220903 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/parser.c
tools/regression/bin/sh/expansion/length6.0 [new file with mode: 0644]