]> git.lyx.org Git - lyx.git/blobdiff - src/support/rename.C
fix a couple of hard crashes, constify local variables, whitespace changes, some...
[lyx.git] / src / support / rename.C
index 97c4ca0562348920f7a8ccc4a5d78a6a8d5f54c5..f6a33670628bec1d76888f2f2a45957b49cbba8c 100644 (file)
@@ -7,6 +7,10 @@
 bool lyx::rename(string const & from, string const & to)
 {
        if (::rename(from.c_str(), to.c_str()) == -1)
-               return lyx::copy(from, to);
+               if (lyx::copy(from, to)) {
+                       lyx::unlink(from);
+                       return true;
+               } else
+                       return false;
        return true;
 }