From 72b9c5c702883875b6ef27d2aa7e5a09dafbb001 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 1 Apr 2004 21:03:52 +0000 Subject: [PATCH] Soothe Georg's minor irritation. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8588 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 5 +++++ src/support/filetools.C | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 0ac54d349a..7f5ce3ba9a 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2004-04-01 Georg Baum + + * filetools.C (DeleteAllFilesInDir): delete directories with + rmdir(), unlink() does not work + 2004-03-27 Angus Leeming * forkedcontr.C (child_handler): squash warning about a diff --git a/src/support/filetools.C b/src/support/filetools.C index 5388a376f0..4a62faf65d 100644 --- a/src/support/filetools.C +++ b/src/support/filetools.C @@ -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; }