From 40ee1fcfb77731f3cd7385882f41630af6aedb33 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sat, 7 Oct 2023 23:30:49 +0200 Subject: reduce line limit to 95 --- src/maildir.cc | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'src/maildir.cc') 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(this), messages.end(), endIterator.bset, endIterator.mod); + endIterator = iterator(const_cast(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; } -- cgit v1.2.3