58e34de6bb
fixes) where a variable containing a CTL char (the only possibility used to be CTLESC (0x81)) would lose that character if the variable was expanded when "set -f" (noglob) was in effect. 1.128 made this worse by adding more 0x8z values (a couple more) which would see the same behaviour, and one of those was noticed by Martijn Dekker. The reasoning was that when noglob is on, when a var is expanded, there are no magic chars, so (apparently) no need to escape anything. Hence nothing was escaped .. including any CTL chars that happened to be present. When we later rmescapes() the CTL chars that we expect might occur are summarily removed - even if they weren't really CTL chars, but just data masquerading. We must *always* escape any CTL char clones that are in the var value, no matter what other conditions apply, and what we expect to happen next. While here, fix rmescapes() (and its $(()) clone, rmescapes_nl()) to be more robust, less likely to forget to delete anything (which was not the issue here, just the reverse) and in a DEBUG shell, have the shell abort() if it encounters something in rmescapes() it is not anticipating, so the code can be made to handle it, or if it should not happen, we can find out why it did. XXX pullup -8 (but will need to be via patch, code is quite different). |
||
---|---|---|
.. | ||
cat | ||
chio | ||
chmod | ||
cp | ||
csh | ||
date | ||
dd | ||
df | ||
domainname | ||
echo | ||
ed | ||
expr | ||
hostname | ||
kill | ||
ksh | ||
ln | ||
ls | ||
mkdir | ||
mt | ||
mv | ||
pax | ||
ps | ||
pwd | ||
rcmd | ||
rcp | ||
rm | ||
rmdir | ||
sh | ||
sleep | ||
stty | ||
sync | ||
test | ||
Makefile | ||
Makefile.inc |