From 05432911063846ff8cfddfe63e6e0039ec2b9d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sun, 2 Dec 2001 16:18:13 +0000 Subject: [PATCH] dirlist patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3129 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 3 +++ src/support/filetools.C | 7 +++++++ 2 files changed, 10 insertions(+) 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;