]> git.lyx.org Git - features.git/commitdiff
Soothe Georg's minor irritation.
authorAngus Leeming <leeming@lyx.org>
Thu, 1 Apr 2004 21:03:52 +0000 (21:03 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 1 Apr 2004 21:03:52 +0000 (21:03 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8588 a592a061-630c-0410-9148-cb99ea01b6c8

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

index 0ac54d349a864b9e8ea879f99633e55bfc25172f..7f5ce3ba9ac89a81fa62cff53fd3c52f4fcc45c0 100644 (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>
 
        * forkedcontr.C (child_handler): squash warning about a
index 5388a376f0f47868c1e3d98410febac957d4e170..4a62faf65d0ae98e39daf36f00edd4bec0055d1b 100644 (file)
@@ -436,9 +436,11 @@ int DeleteAllFilesInDir(string const & path)
 
                bool deleted = true;
                FileInfo fi(unlinkpath);
-               if (fi.isOK() && fi.isDir())
+               if (fi.isOK() && fi.isDir()) {
                        deleted = (DeleteAllFilesInDir(unlinkpath) == 0);
-               deleted &= (unlink(unlinkpath) == 0);
+                       deleted &= (rmdir(unlinkpath) == 0);
+               } else
+                       deleted &= (unlink(unlinkpath) == 0);
                if (!deleted)
                        return_value = -1;
        }