diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 17:56:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-03-18 17:56:14 -0700 |
commit | 34230c3f6e3d7a147e9329369144bc7e1cbf2066 (patch) | |
tree | dd8025c0e2b21594ebb89817e7597e0b66e27dda | |
parent | 8806f0b62f983a9d76b8d108e7d480e93ae4afb5 (diff) | |
download | txr-34230c3f6e3d7a147e9329369144bc7e1cbf2066.tar.gz txr-34230c3f6e3d7a147e9329369144bc7e1cbf2066.tar.bz2 txr-34230c3f6e3d7a147e9329369144bc7e1cbf2066.zip |
configure: bugfix in shell escaping code
* configure: in the case when the argument contains
single quotes, we try to identify the subcase that cannot use
double quotes instead. That subcase is not correctly
identified: it occurs when there are double quotes, dollar
signs **or backslashes**. For instance the data '\ cannot
be put into double quotes as "'\" on account of the backslash,
which is an active character in double quotes. We also
simplify the pattern by using a character class.
-rwxr-xr-x | configure | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -92,7 +92,7 @@ for arg in "$0" ${@+"$@"} ; do case $arg in *"'"* ) case $arg in - *'"'* | *'$'* ) + *[\"\$\\]* ) cmdline="$cmdline'$(printf "%s" "$arg" | sed -e "s/'/'\\\\''/g")'" ;; * ) |