]> git.lyx.org Git - lyx.git/blobdiff - src/support/rename.C
various changes
[lyx.git] / src / support / rename.C
index 97c4ca0562348920f7a8ccc4a5d78a6a8d5f54c5..7c079a2100eb2bbcd2d683491e382f8cc7265aa4 100644 (file)
@@ -6,7 +6,14 @@
 
 bool lyx::rename(string const & from, string const & to)
 {
+#ifdef __EMX__
+       lyx::unlink(to.c_str());
+#endif
        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;
 }