Soothe Georg's minor irritation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8588 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-04-01 21:03:52 +00:00
parent 12780bf2b6
commit 72b9c5c702
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-04-01 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* filetools.C (DeleteAllFilesInDir): delete directories with
rmdir(), unlink() does not work
2004-03-27 Angus Leeming <leeming@lyx.org> 2004-03-27 Angus Leeming <leeming@lyx.org>
* forkedcontr.C (child_handler): squash warning about a * forkedcontr.C (child_handler): squash warning about a

View File

@ -436,8 +436,10 @@ int DeleteAllFilesInDir(string const & path)
bool deleted = true; bool deleted = true;
FileInfo fi(unlinkpath); FileInfo fi(unlinkpath);
if (fi.isOK() && fi.isDir()) if (fi.isOK() && fi.isDir()) {
deleted = (DeleteAllFilesInDir(unlinkpath) == 0); deleted = (DeleteAllFilesInDir(unlinkpath) == 0);
deleted &= (rmdir(unlinkpath) == 0);
} else
deleted &= (unlink(unlinkpath) == 0); deleted &= (unlink(unlinkpath) == 0);
if (!deleted) if (!deleted)
return_value = -1; return_value = -1;