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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]