From: Lars Gullik Bjønnes Date: Sun, 2 Dec 2001 16:18:13 +0000 (+0000) Subject: dirlist patch X-Git-Tag: 1.6.10~20249 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=05432911063846ff8cfddfe63e6e0039ec2b9d39;p=features.git dirlist patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3129 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 27c41bcbcf..f9b11c75e1 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,6 @@ +2001-12-01 John Levon + + * filetools.C: more robust failure for DirList() 2001-11-29 André Pönitz diff --git a/src/support/filetools.C b/src/support/filetools.C index cb77c4b5cf..64a1cc77d8 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -208,6 +208,13 @@ vector const DirList(string const & dir, string const & ext) extension.insert(0, "."); vector 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;