diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-07 22:33:50 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-08 11:35:51 +0200 |
commit | 1978c49bea5b439d993067c055cec47e70db8fd6 (patch) | |
tree | 255caea96a13f95564e6b631be9a4ac55ce33cd9 /src/maildir-delete.cc | |
parent | 3b1278f5459514a6d6364f068ff97b8a0432057b (diff) |
minor refactoring
Diffstat (limited to 'src/maildir-delete.cc')
-rw-r--r-- | src/maildir-delete.cc | 20 |
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 == ".") { |