Browse Source

try to fix https://bz.apache.org/bugzilla/show_bug.cgi?id=59321

suggested patch by Jeffrey Adamson
master
Stefan Bodewig 8 years ago
parent
commit
c2666b1996
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/script/ant

+ 7
- 2
src/script/ant View File

@@ -35,8 +35,13 @@ for arg in "$@" ; do
if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then
show_help=true
fi
# wrap all arguments as "" strings, escape any internal back-slash, double-quote, $, or back-tick characters
ant_exec_args="$ant_exec_args \"$(printf '%s\n' "$arg" | sed -e 's@\$\|`\|"\|\\@\\\0@g' )\""
# escape $, ", and \ characters by inserting a \
esc_arg=`echo "$arg" | sed -e 's@[$"\\]@\\\\\\\\\0@g' `
# escape ` by inserting a \
esc_arg=`echo "$esc_arg" | sed -e 's@\`@\\\\\`@g'`
# wrap escaped arg as a quoted argument
quoted_arg="\"$esc_arg\""
ant_exec_args="$ant_exec_args $quoted_arg"
fi
done



Loading…
Cancel
Save