]> git.lyx.org Git - lyx.git/blob - src/support/rename.C
fix a couple of hard crashes, constify local variables, whitespace changes, some...
[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         if (::rename(from.c_str(), to.c_str()) == -1)
10                 if (lyx::copy(from, to)) {
11                         lyx::unlink(from);
12                         return true;
13                 } else
14                         return false;
15         return true;
16 }