ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 58898] ANT wrapper script can not handle double-quote or backslash characters in arguments
Date Thu, 21 Apr 2016 21:18:22 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=58898

--- Comment #5 from jwadamson@gmail.com ---
Thank you for the example. I think the 1.9.6 behavior in your case was
objectively incorrect. It worked out to the right answer, but for the wrong
reasons.

'-Dbranch.command="co' -r '"'

In /bin/sh, quoting does not nest. So the example command line has 3 separate
arguments passed to ant:
  `-Dbranch.commmand="co`
  `-r`
  `"` (a literal double-quote)

The ant script in 1.9.6 was smushing these back together as (quoting the space
between each original argument)
  `"-Dbranch.command="co" "-r" """`. 
/bin/sh processing then interprets this mess as a single argument in the exec
command (with some spurious empty strings concatenated into the value):
  `-Dbranch.command=co -r `

The ant script in 1.9.7 keeps those original 3 arguments separate and causes
the error about the `-r` argument.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message