]> git.lyx.org Git - features.git/commitdiff
dirlist patch
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 16:18:13 +0000 (16:18 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Dec 2001 16:18:13 +0000 (16:18 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3129 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/ChangeLog
src/support/filetools.C

index 27c41bcbcf7297f140ed5a37c7e74466995b96fe..f9b11c75e1331f4b8efa383d64e09e11c535b91e 100644 (file)
@@ -1,3 +1,6 @@
+2001-12-01  John Levon  <moz@compsoc.man.ac.uk>
+
+       * filetools.C: more robust failure for DirList()
 
 2001-11-29  André Pönitz <poenitz@gmx.net>
        
index cb77c4b5cf43c3e3e834222e8059d2085be22cab..64a1cc77d83270ed8d61e2a2f227863ce2df48f1 100644 (file)
@@ -208,6 +208,13 @@ vector<string> const DirList(string const & dir, string const & ext)
                extension.insert(0, ".");
        vector<string> dirlist;
        DIR * dirp = ::opendir(dir.c_str());
+       if (!dirp) {
+               lyxerr[Debug::FILES] 
+                       << "Directory \"" << dir
+                       << "\" does not exist to DirList." << endl;
+               return dirlist;
+       }
        dirent * dire;
        while ((dire = ::readdir(dirp))) {
                string const fil = dire->d_name;