summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-03-18 17:56:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-03-18 17:56:14 -0700
commit34230c3f6e3d7a147e9329369144bc7e1cbf2066 (patch)
treedd8025c0e2b21594ebb89817e7597e0b66e27dda
parent8806f0b62f983a9d76b8d108e7d480e93ae4afb5 (diff)
downloadtxr-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-xconfigure2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure b/configure
index f001ba97..41533afb 100755
--- a/configure
+++ b/configure
@@ -92,7 +92,7 @@ for arg in "$0" ${@+"$@"} ; do
case $arg in
*"'"* )
case $arg in
- *'"'* | *'$'* )
+ *[\"\$\\]* )
cmdline="$cmdline'$(printf "%s" "$arg" | sed -e "s/'/'\\\\''/g")'"
;;
* )