]> git.lyx.org Git - lyx.git/blobdiff - src/bufferlist.C
small bugfix
[lyx.git] / src / bufferlist.C
index 7cefba0ba02ef14bd9a359df346f771c419de06e..d602fc6e598cdaf58aa1c5b76ce89d944fa4eb71 100644 (file)
@@ -449,7 +449,7 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
                bool templateok = false;
                LyXLex lex(0, 0);
                lex.setFile(tname);
-               if (lex.IsOK()) {
+               if (lex.isOK()) {
                        if (b->readFile(lex)) {
                                templateok = true;
                        }
@@ -477,8 +477,12 @@ Buffer * BufferList::newFile(string const & name, string tname, bool isNamed)
 
 Buffer * BufferList::loadLyXFile(string const & filename, bool tolastfiles)
 {
-       // make sure our path is absolute
-       string const s = MakeAbsPath(filename);
+       // get absolute path of file and add ".lyx" to the filename if
+       // necessary
+       string s = FileSearch(string(), filename, "lyx");
+       if (s.empty()) {
+               s = filename;
+       }
 
        // file already open?
        if (exists(s)) {