]> git.lyx.org Git - lyx.git/blobdiff - src/support/rename.C
remove !NEW_INSETS cruft
[lyx.git] / src / support / rename.C
index bd619347e0c46b809b37419e8fd27aba38ca7024..f6a33670628bec1d76888f2f2a45957b49cbba8c 100644 (file)
@@ -6,5 +6,11 @@
 
 bool lyx::rename(string const & from, string const & to)
 {
-       return ::rename(from.c_str(), to.c_str()) != -1;
+       if (::rename(from.c_str(), to.c_str()) == -1)
+               if (lyx::copy(from, to)) {
+                       lyx::unlink(from);
+                       return true;
+               } else
+                       return false;
+       return true;
 }