]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.C
small changes read changelog
[lyx.git] / src / support / filetools.C
index 10335730aac05a05de296288debc686638ebdd97..c247043bc34f6ace27376f27651bb7bd30a41920 100644 (file)
@@ -68,13 +68,13 @@ extern string system_tempdir;
 
 bool IsLyXFilename(string const & filename)
 {
-       return suffixIs(filename, ".lyx");
+       return suffixIs(lowercase(filename), ".lyx");
 }
 
 
 bool IsSGMLFilename(string const & filename)
 {
-       return suffixIs(filename, ".sgml");
+       return suffixIs(lowercase(filename), ".sgml");
 }
 
 
@@ -226,7 +226,7 @@ vector<string> const DirList(string const & dir, string const & ext)
           vector<string> dirlist;
           directory_iterator dit("dir");
           while (dit != directory_iterator()) {
-                  string fil = (*dit).filename;
+                  string fil = dit->filename;
                   if (prefixIs(fil, extension)) {
                           dirlist.push_back(fil);
                   }
@@ -408,7 +408,8 @@ int DeleteAllFilesInDir (string const & path)
                        continue;
                string const unlinkpath = AddName (path, temp);
 
-               lyxerr.debug() << "Deleting file: " << unlinkpath << endl;
+               lyxerr[Debug::FILES] << "Deleting file: " << unlinkpath 
+                                    << endl;
 
                bool deleted = true;
                if (FileInfo(unlinkpath).isDir())
@@ -1072,7 +1073,10 @@ findtexfile(string const & fil, string const & /*format*/)
         lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
                             << "kpse result = `" << strip(c.second, '\n') 
                             << "'" << endl;
-        return c.first != -1 ? strip(c.second, '\n') : string();
+       if (c.first != -1) 
+               return strip(strip(c.second, '\n'), '\r');
+       else
+               return string();
 }