]> git.lyx.org Git - lyx.git/blob - src/support/rename.C
fix typo that put too many include paths for most people
[lyx.git] / src / support / rename.C
1 #include <config.h>
2
3 #include <cstdio>
4
5 #include "support/lyxlib.h"
6
7 bool lyx::rename(string const & from, string const & to)
8 {
9 #ifdef __EMX__
10         lyx::unlink(to.c_str());
11 #endif
12         if (::rename(from.c_str(), to.c_str()) == -1)
13                 if (lyx::copy(from, to)) {
14                         lyx::unlink(from);
15                         return true;
16                 } else
17                         return false;
18         return true;
19 }