瀏覽代碼

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 年之前
父節點
當前提交
a80317c4b3
共有 1 個文件被更改,包括 2 次插入0 次删除
  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>
       <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}">