Return-Path: Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 21703 invoked by uid 500); 22 Jul 2003 14:53:55 -0000 Mailing-List: contact dev-help@ant.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 dev@ant.apache.org Received: (qmail 21692 invoked by uid 500); 22 Jul 2003 14:53:55 -0000 Received: (qmail 21689 invoked from network); 22 Jul 2003 14:53:55 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 22 Jul 2003 14:53:55 -0000 Received: (qmail 90789 invoked by uid 1146); 22 Jul 2003 14:53:55 -0000 Date: 22 Jul 2003 14:53:55 -0000 Message-ID: <20030722145355.90787.qmail@icarus.apache.org> From: bodewig@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bodewig 2003/07/22 07:53:55 Modified: src/main/org/apache/tools/ant/util FileUtils.java Log: removeLeadingPath doesn't work if leading is a filesystem root - found by Antoine Revision Changes Path 1.51 +7 -5 ant/src/main/org/apache/tools/ant/util/FileUtils.java Index: FileUtils.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- FileUtils.java 19 Jul 2003 11:20:22 -0000 1.50 +++ FileUtils.java 22 Jul 2003 14:53:55 -0000 1.51 @@ -1186,10 +1186,12 @@ return ""; } - // if leading's path ends with a slash, it will be stripped by - // normalize - we always add one so we never think /foo was a - // parent directory of /foobar - l += File.separator; + // ensure that l ends with a / + // so we never think /foo was a parent directory of /foobar + if (!l.endsWith("/")) { + l += File.separator; + } + if (p.startsWith(l)) { return p.substring(l.length()); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org