tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r649993 - /tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java
Date Sun, 20 Apr 2008 22:39:40 GMT
Author: markt
Date: Sun Apr 20 15:39:35 2008
New Revision: 649993

URL: http://svn.apache.org/viewvc?rev=649993&view=rev
Log:
Fix bug 31257. Quote endorsed dirs if they contain a space.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java?rev=649993&r1=649992&r2=649993&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/AntCompiler.java Sun Apr 20 15:39:35 2008
@@ -175,8 +175,10 @@
             if(endorsed != null) {
                 Javac.ImplementationSpecificArgument endorsedArg = 
                     javac.createCompilerArg();
-                endorsedArg.setLine("-J-Djava.endorsed.dirs="+endorsed);
-                info.append("    endorsed dir=" + endorsed + "\n");
+                endorsedArg.setLine("-J-Djava.endorsed.dirs=" +
+                        quotePathList(endorsed));
+                info.append("    endorsed dir=" + quotePathList(endorsed) +
+                        "\n");
             } else {
                 info.append("    no endorsed dirs specified\n");
             }
@@ -275,7 +277,26 @@
         }
     }
 
-    
+    private String quotePathList(String list) {
+        StringBuffer result = new StringBuffer(list.length() + 10);
+        StringTokenizer st = new StringTokenizer(list, File.pathSeparator);
+        while (st.hasMoreTokens()) {
+            String token = st.nextToken();
+            if (token.indexOf(' ') == -1) {
+                result.append(token);
+            } else {
+                result.append('\"');
+                result.append(token);
+                result.append('\"');
+            }
+            if (st.hasMoreTokens()) {
+                result.append(File.pathSeparatorChar);
+            }
+        }
+        return result.toString();
+    }
+
+
     protected static class SystemLogHandler extends PrintStream {
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message