summaryrefslogtreecommitdiff
path: root/src/maildir-delete.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/maildir-delete.cc')
-rw-r--r--src/maildir-delete.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/maildir-delete.cc b/src/maildir-delete.cc
index 9ed162b..b0abb2a 100644
--- a/src/maildir-delete.cc
+++ b/src/maildir-delete.cc
@@ -6,14 +6,12 @@
* ----------------------------------------------------------------- **/
#include "maildir.h"
-#include <fcntl.h>
-#include <unistd.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
#include <dirent.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
using namespace ::std;
@@ -24,21 +22,18 @@ namespace {
bool recursiveDelete(const string &path)
{
DIR *mydir = opendir(path.c_str());
- if (mydir == 0)
- return false;
+ if (mydir == 0) return false;
struct dirent *mydirent;
while ((mydirent = readdir(mydir)) != 0) {
string d = mydirent->d_name;
- if (d == "." || d == "..")
- continue;
+ if (d == "." || d == "..") continue;
string f = path + "/" + d;
struct stat mystat;
if (lstat(f.c_str(), &mystat) != 0) {
- if (errno == ENOENT)
- continue;
+ if (errno == ENOENT) continue;
return false;
}
@@ -78,9 +73,7 @@ bool Binc::Maildir::deleteMailbox(const string &s_in)
}
if (rmdir(s_in.c_str()) != 0) {
- setLastError("error deleting Maildir: "
- + string(strerror(errno))
- + " - status is undefined");
+ setLastError("error deleting Maildir: " + string(strerror(errno)) + " - status is undefined");
return false;
}