]> git.lyx.org Git - lyx.git/blobdiff - src/support/rename.C
fix typo that put too many include paths for most people
[lyx.git] / src / support / rename.C
index bd619347e0c46b809b37419e8fd27aba38ca7024..7c079a2100eb2bbcd2d683491e382f8cc7265aa4 100644 (file)
@@ -6,5 +6,14 @@
 
 bool lyx::rename(string const & from, string const & to)
 {
-       return ::rename(from.c_str(), to.c_str()) != -1;
+#ifdef __EMX__
+       lyx::unlink(to.c_str());
+#endif
+       if (::rename(from.c_str(), to.c_str()) == -1)
+               if (lyx::copy(from, to)) {
+                       lyx::unlink(from);
+                       return true;
+               } else
+                       return false;
+       return true;
 }