Browse Source

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).
Martijn Laarman 10 years ago
parent
commit
a80317c4b3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      dev-tools/src/main/resources/ant/integration-tests.xml

+ 2 - 0
dev-tools/src/main/resources/ant/integration-tests.xml

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