Explorar o código

trivial rename

David Rose %!s(int64=16) %!d(string=hai) anos
pai
achega
712797797e
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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();