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.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/maildir-delete.cc b/src/maildir-delete.cc
index b0abb2a..356128b 100644
--- a/src/maildir-delete.cc
+++ b/src/maildir-delete.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file maildir-delete.cc
* @brief Implementation of the Maildir class.
* @author Andreas Aardal Hanssen
* @date 2002-2005
- * ----------------------------------------------------------------- **/
+ */
+
#include "maildir.h"
#include <errno.h>
@@ -14,18 +15,18 @@
#include <sys/types.h>
#include <unistd.h>
-using namespace ::std;
using namespace Binc;
+using std::string;
namespace {
bool recursiveDelete(const string &path)
{
DIR *mydir = opendir(path.c_str());
- if (mydir == 0) return false;
+ if (mydir == nullptr) return false;
struct dirent *mydirent;
- while ((mydirent = readdir(mydir)) != 0) {
+ while ((mydirent = readdir(mydir)) != nullptr) {
string d = mydirent->d_name;
if (d == "." || d == "..") continue;
@@ -46,11 +47,9 @@ namespace {
closedir(mydir);
return false;
}
- } else {
- if (unlink(f.c_str()) != 0 && errno != ENOENT) {
- closedir(mydir);
- return false;
- }
+ } else if (unlink(f.c_str()) != 0 && errno != ENOENT) {
+ closedir(mydir);
+ return false;
}
}
@@ -59,7 +58,6 @@ namespace {
}
}
-//------------------------------------------------------------------------
bool Binc::Maildir::deleteMailbox(const string &s_in)
{
if (s_in == ".") {