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
commit04266f09b0d2c31d6cfb6148eada4550fe478f29 (patch)
treedd8025c0e2b21594ebb89817e7597e0b66e27dda
parenta05104a12feb19f70c542446f93ea206430766f2 (diff)
downloadtxr-04266f09b0d2c31d6cfb6148eada4550fe478f29.tar.gz
txr-04266f09b0d2c31d6cfb6148eada4550fe478f29.tar.bz2
txr-04266f09b0d2c31d6cfb6148eada4550fe478f29.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")'"
;;
* )