diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 12fcf633b..dcf109346 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -6,6 +6,7 @@ Andreas Mross Andrew Everitt Anil K. Vijendran Anli Shundi +Anthony Goubard Anthony Green Antoine Levy-Lambert Anton Mazkovoi diff --git a/WHATSNEW b/WHATSNEW index f38b614f7..62c9e0a75 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -218,6 +218,10 @@ Fixed bugs: * and now correctly merge multiple nested patternsets. Bugzilla Report 38973. +* On case-insensitive filesystems, a to change filename case + erroneously deleted the "destination" file before attempting to rename + the source file. Bugzilla 37701. + Other changes: -------------- * took in bugzilla report 39320. diff --git a/src/main/org/apache/tools/ant/taskdefs/Move.java b/src/main/org/apache/tools/ant/taskdefs/Move.java index 07d3dbf40..f76da561f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Move.java +++ b/src/main/org/apache/tools/ant/taskdefs/Move.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 The Apache Software Foundation + * Copyright 2000-2006 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -373,7 +373,8 @@ public class Move extends Copy { if (parent != null && !parent.exists()) { parent.mkdirs(); } - if (destFile.isFile() && !destFile.delete()) { + if (destFile.isFile() && !destFile.equals(sourceFile) + && !destFile.delete()) { throw new BuildException("Unable to remove existing " + "file " + destFile); }