From deda7ecc9305fca610e5bac6149db74f2d16993c Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Wed, 18 May 2005 23:39:47 +0000 Subject: [PATCH] Added really ugly shell quoting. But it works even for multiline values. --- maint/mc-test | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/maint/mc-test b/maint/mc-test index b56204831..8c29f4a06 100755 --- a/maint/mc-test +++ b/maint/mc-test @@ -88,6 +88,13 @@ EOF exit 1 } +eval_arg() { + _shquote_var=`echo x"$1" | sed -e '1s,^x\([^=]*\)=.*,\1,' -e '1q'` + _shquote_val=`echo x"$1" | sed '1s,^x[^=]*=\(.*\),\1,'` + _shquote_qval=`echo x"${_shquote_val}" | sed -e '1s,.,,' -e s,\',\'\\\\\\\\\'\',g` + eval "${_shquote_var}='${_shquote_qval}'" +} + while test $# -ne 0; do case "$1" in -config) shift; case "$1" in /*) . "$1";; *) . "./$1";; esac; shift;; @@ -121,7 +128,7 @@ while test $# -ne 0; do -nice) shift; mc_nice_value="$1"; shift;; -maxlines) shift; mc_maxlines="$1"; shift;; -quiet) shift; quiet="yes";; - mc_*=*) eval "$1"; shift;; + mc_*=*) eval_arg "$1"; shift;; --) shift; break;; -) shift; break;;