dirlist patch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3129 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-12-02 16:18:13 +00:00
parent 3454ed1bc2
commit 0543291106
2 changed files with 10 additions and 0 deletions

View 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>

View 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;