]> git.lyx.org Git - lyx.git/blobdiff - src/buffer_funcs.C
Next step of true unicode filenames: Use support::FileName instead of
[lyx.git] / src / buffer_funcs.C
index fae278648eb63d135638af6dc90562d1a6199a53..d936400d3d6d19e0950a03f107dc8098decd81f9 100644 (file)
@@ -53,7 +53,9 @@ namespace lyx {
 using namespace std;
 
 using support::bformat;
+using support::FileName;
 using support::libFileSearch;
+using support::makeAbsPath;
 using support::makeDisplayPath;
 using support::onlyFilename;
 using support::onlyPath;
@@ -127,7 +129,7 @@ bool readFile(Buffer * const b, string const & s)
                        return b->readFile(a);
                case 1:
                        // Here we delete the autosave
-                       unlink(a);
+                       unlink(FileName(makeAbsPath(a)));
                        break;
                default:
                        return false;
@@ -185,7 +187,7 @@ Buffer * newFile(string const & filename, string const & templatename,
        string tname;
        // use defaults.lyx as a default template if it exists.
        if (templatename.empty())
-               tname = libFileSearch("templates", "defaults.lyx");
+               tname = libFileSearch("templates", "defaults.lyx").absFilename();
        else
                tname = templatename;