Browse Source

trivial rename

David Rose 16 years ago
parent
commit
712797797e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      dtool/src/dtoolutil/filename.cxx

+ 6 - 0
dtool/src/dtoolutil/filename.cxx

@@ -2405,6 +2405,12 @@ unlink() const {
 bool Filename::
 rename_to(const Filename &other) const {
   assert(!get_pattern());
+
+  if (*this == other) {
+    // Trivial success.
+    return true;
+  }
+
   string os_specific = to_os_specific();
   string other_os_specific = other.to_os_specific();