BUG: too many quotes on cleaned env variables

- Added quoting to handle spaces in environment values in commit 50852b33
  (#1007, #1008). However, quoting is only needed for eval mode.

  In regular mode, quoting should not be part of the output, instead it
  should be done on the caller side.
This commit is contained in:
Mark Olesen
2018-11-25 09:21:42 +01:00
parent 6b99ffe0a9
commit 0446e73485

View File

@ -226,12 +226,25 @@ done
IFS="$oldIFS" # Restore initial IFS IFS="$oldIFS" # Restore initial IFS
# Output:
#
# For eval mode, add quotes around the argument.
# - eg, <. PATH="path1;path2;...">
#
# With regular output, any quoting would be done on the caller side.
# - eg, <cleaned="($foamClean -env=PATH foo)
printDebug "output>$dirList<" printDebug "output>$dirList<"
if [ -n "$optVerbose" ] if [ -n "$optVerbose" ]
then then
echo "output: \"$dirList\"" 1>&2 echo "output: \"$dirList\"" 1>&2
fi fi
echo "$shellOutput\"$dirList\"" if [ -n "$shellOutput" ]
then
echo "$shellOutput\"$dirList\""
else
echo "$dirList"
fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------