cmd /C needs to be quoted as a whole

To support spaces in both the command as well as its arguments cmd needs
be called like this:

cmd /C ""c:\a b\c.bat" "argument 1" "argument2""

ant was running

cmd /C "c:\a b\c.bat" "argument 1" "argument2"

which in windows causes to be preprocessed to

cmd /C c:\a b\c.bat" "argument 1" "argument2

Which would make it appear as though ant was not properly quoting (which
it did sort of).
This commit is contained in:
Martijn Laarman 2015-08-15 20:49:40 +02:00
parent 6e2dc73023
commit a80317c4b3
1 changed files with 2 additions and 0 deletions

View File

@ -32,8 +32,10 @@
<echoxml><exec script="${script.base}"><nested/></exec></echoxml>
<exec executable="cmd" osfamily="winnt" dir="${temp.cwd}" failonerror="${failonerror}" spawn="@{spawn}" taskname="${script.base}">
<arg value="/c"/>
<arg value="&quot;"/>
<arg value="@{script}.bat"/>
<nested/>
<arg value="&quot;"/>
</exec>
<exec executable="sh" osfamily="unix" dir="${temp.cwd}" failonerror="${failonerror}" spawn="@{spawn}" taskname="${script.base}">