env-driver: Quote value for assignment in eval.

This permits using path_add when the environment variable already contains
entries with characters that break shell quoting rules.

Technically we'd need to pipe to sed or similar to re-quote single quotes,
hopefully that won't come up...
wilder
Michael Pyne 9 years ago
parent 6062a35237
commit b376b6c638
  1. 6
      sample-kde-env-master.sh

@ -72,10 +72,10 @@ path_add()
{
eval curVal=\$'{'$1'-}'
if [ -n "$curVal" ]; then
eval "$1"="$2:$curVal";
if test -n "$curVal"; then
eval "$1"="$2:'$curVal'";
else
eval "$1"="$2"
eval "$1"="'$2'"
fi
}

Loading…
Cancel
Save