Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 22632 invoked from network); 3 Dec 2001 21:47:28 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 3 Dec 2001 21:47:28 -0000 Received: (qmail 22075 invoked by uid 97); 3 Dec 2001 21:47:08 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 22013 invoked by uid 97); 3 Dec 2001 21:47:07 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 21970 invoked from network); 3 Dec 2001 21:47:07 -0000 Message-ID: <3C0BF2F6.2040001@radik.com> Date: Mon, 03 Dec 2001 13:47:34 -0800 From: Alan Gates User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20010913 X-Accept-Language: en-us MIME-Version: 1.0 To: ant-dev@jakarta.apache.org Subject: PATCH - fix for bug 5219 Content-Type: multipart/mixed; boundary="------------070802010005020109010902" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------070802010005020109010902 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Attached. Alan F. Gates Software Engineer Radik Software --------------070802010005020109010902 Content-Type: text/plain; name="patchfile.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patchfile.txt" Index: PathConvert.java =================================================================== RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v retrieving revision 1.5 diff -u -r1.5 PathConvert.java --- PathConvert.java 2001/11/30 17:35:06 1.5 +++ PathConvert.java 2001/12/03 21:26:19 @@ -254,7 +254,6 @@ // Determine the from/to char mappings for dir sep char fromDirSep = onWindows ? '\\' : '/'; - char toDirSep = dirSep.charAt(0); StringBuffer rslt = new StringBuffer( 100 ); @@ -268,8 +267,22 @@ // Now convert the path and file separator characters from the // current os to the target os. - - elem = elem.replace( fromDirSep, toDirSep ); + // Optimize for most likely case + if (dirSep.length() == 1) { + char toDirSep = dirSep.charAt(0); + elem = elem.replace( fromDirSep, toDirSep ); + } else { + StringBuffer s = new StringBuffer(); + for (int j = 0; j < elem.length(); j++) { + char c = elem.charAt(j); + if (c == fromDirSep) { + s.append(dirSep); + } else { + s.append(c); + } + } + elem = s.toString(); + } if( i != 0 ) rslt.append( pathSep ); rslt.append( elem ); --------------070802010005020109010902 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: --------------070802010005020109010902--