diff options
Diffstat (limited to 'src/maildir.cc')
-rw-r--r-- | src/maildir.cc | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/src/maildir.cc b/src/maildir.cc index dc7e45a..4452010 100644 --- a/src/maildir.cc +++ b/src/maildir.cc @@ -146,7 +146,10 @@ Mailbox::iterator Maildir::begin(const SequenceSet &bset, unsigned int mod) cons Mailbox::iterator Maildir::end(void) const { - endIterator = iterator(const_cast<Maildir *>(this), messages.end(), endIterator.bset, endIterator.mod); + endIterator = iterator(const_cast<Maildir *>(this), + messages.end(), + endIterator.bset, + endIterator.mod); return Mailbox::iterator(endIterator); } @@ -181,7 +184,10 @@ void Maildir::setPath(const string &path_in) path = path_in; } -bool Maildir::getUpdates(bool doscan, unsigned int type, PendingUpdates &updates, bool forceScan) +bool Maildir::getUpdates(bool doscan, + unsigned int type, + PendingUpdates &updates, + bool forceScan) { if (doscan && scan(forceScan) != Success) return false; @@ -312,7 +318,12 @@ bool Maildir::getStatus(const string &path, Status &s) const char cacheFileVersionBuffer[512]; - if (sscanf(inputBuffer, "%s %u %u", cacheFileVersionBuffer, &readUidValidity, &readUidNext) != 3 + if (sscanf(inputBuffer, + "%s %u %u", + cacheFileVersionBuffer, + &readUidValidity, + &readUidNext) + != 3 || strcmp(cacheFileVersionBuffer, BINC_CACHE) != 0) { fclose(fp); @@ -328,7 +339,13 @@ bool Maildir::getStatus(const string &path, Status &s) const char readUnique[512]; while (fgets(inputBuffer, sizeof(inputBuffer), fp)) { inputBuffer[sizeof(inputBuffer) - 1] = '\0'; - if (sscanf(inputBuffer, "%u %u %u %s", &readUID, &readInternalDate, &readSize, readUnique) != 4) + if (sscanf(inputBuffer, + "%u %u %u %s", + &readUID, + &readInternalDate, + &readSize, + readUnique) + != 4) { fclose(fp); readUidValidity = 0; @@ -355,7 +372,8 @@ bool Maildir::getStatus(const string &path, Status &s) const struct dirent *direntp; while ((direntp = readdir(dirp)) != nullptr) { const string filename = direntp->d_name; - if (filename[0] == '.' || filename.find(':') != string::npos || filename.find('/') != string::npos) + if (filename[0] == '.' || filename.find(':') != string::npos + || filename.find('/') != string::npos) continue; ++recent; @@ -549,12 +567,12 @@ bool Maildir::commitNewMessages(const string &mbox) // FIXME: The message was probably moves away from new/ by // another IMAP session. bincWarning << "error rollbacking after failed commit to " << toImapString(mbox) - << ", failed to unlink " << toImapString(second) << ": " << strerror(errno) - << endl; + << ", failed to unlink " << toImapString(second) << ": " + << strerror(errno) << endl; } else { bincWarning << "error rollbacking after failed commit to " << toImapString(mbox) - << ", failed to unlink " << toImapString(second) << ": " << strerror(errno) - << endl; + << ", failed to unlink " << toImapString(second) << ": " + << strerror(errno) << endl; newMessages.clear(); return false; } |