summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-03-25 22:35:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-03-25 22:35:37 -0700
commitf65653c9a375511f0b3af588082e441e9c5fcb0d (patch)
tree1e40090aca59732054596b6cd9d4f4ebbf3d8def
parentc79849f0be4d8d4a3fc1b1386c70daa3f29a5d0e (diff)
downloadtxr-f65653c9a375511f0b3af588082e441e9c5fcb0d.tar.gz
txr-f65653c9a375511f0b3af588082e441e9c5fcb0d.tar.bz2
txr-f65653c9a375511f0b3af588082e441e9c5fcb0d.zip
configure: allow variables to contain quotes.
* configure: When generating the assignment that stores the value of the command line variable into the corresponding shell variable, interpolate $val between single quotes in such a way that single quotes occurring in $val are replaced by the pattern '\''. Thus, variables may contain any character whatsoever.
-rwxr-xr-xconfigure2
1 files changed, 1 insertions, 1 deletions
diff --git a/configure b/configure
index cc6d44a8..250cb772 100755
--- a/configure
+++ b/configure
@@ -225,7 +225,7 @@ while [ $# -gt 0 ] ; do
exit 1
fi
- eval "$var='$val'"
+ eval "$var='$(printf "%s" "$val" | sed -e "s/'/'\\\\''/g")'"
eval "var_given_exists=\${${var}_given+y}"