r1221@thor:  alex | 2006-12-10 05:36:26 +0200
 Fixed: Ant task issue with paths containing spaces

diff --git a/CHANGES.txt b/CHANGES.txt
index a715b6e..8053ce5 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,7 @@
 ===========================================================================
 5.4
 
+Fixed: Ant task issue with paths containing spaces
 Added: for @BeforeGroups and @AfterGroups specifying the groups() attribute will auto-include the method
 			 into those groups by default (previously you had to also provide the value() attribute).
 Added: the load @Tests (invocationCount + threadPoolSize) are triggered simultaneous
diff --git a/src/main/org/testng/TestNGAntTask.java b/src/main/org/testng/TestNGAntTask.java
index b0669a0..7a15272 100644
--- a/src/main/org/testng/TestNGAntTask.java
+++ b/src/main/org/testng/TestNGAntTask.java
@@ -951,7 +951,7 @@
    *

    */

   private static String doubleQuote(String pCommandLineArg) {

-    if(pCommandLineArg.indexOf(" ") != -1) {

+    if(pCommandLineArg.indexOf(" ") != -1 && !(pCommandLineArg.startsWith("\"") && pCommandLineArg.endsWith("\""))) {

       return "\"" + pCommandLineArg + "\"";

     }