]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.C
small changes + patch from Dekel
[lyx.git] / src / support / filetools.C
index 0c5393e518b596993c3c4fbadab899714c75de21..f4480d3b6cf884554de56200626227f84a3f7e89 100644 (file)
@@ -209,14 +209,14 @@ vector<string> const DirList(string const & dir, string const & ext)
 {
        // This is a non-error checking C/system implementation
        string extension(ext);
-       if (extension[0] != '.')
+       if (!extension.empty() && extension[0] != '.')
                extension.insert(0, ".");
        vector<string> dirlist;
        DIR * dirp = ::opendir(dir.c_str());
        dirent * dire;
        while ((dire = ::readdir(dirp))) {
                string const fil = dire->d_name;
-               if (prefixIs(fil, extension)) {
+               if (suffixIs(fil, extension)) {
                        dirlist.push_back(fil);
                }
        }