summaryrefslogtreecommitdiff
path: root/src/maildir-readcache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/maildir-readcache.cc')
-rw-r--r--src/maildir-readcache.cc28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/maildir-readcache.cc b/src/maildir-readcache.cc
index a108242..dbbf4ef 100644
--- a/src/maildir-readcache.cc
+++ b/src/maildir-readcache.cc
@@ -4,10 +4,11 @@
* @author Andreas Aardal Hanssen
* @date 2002-2005
* ----------------------------------------------------------------- **/
-#include <algorithm>
-#include "maildir.h"
#include "convert.h"
#include "globals.h"
+#include "maildir.h"
+
+#include <algorithm>
using namespace ::std;
using namespace Binc;
@@ -47,7 +48,8 @@ Maildir::ReadCacheResult Maildir::readCache(void)
unsigned int readUidNext;
if (sscanf(inputBuffer, "%s %u %u", cacheFileVersionBuffer, &readUidValidity, &readUidNext) != 3
- || strcmp(cacheFileVersionBuffer, BINC_CACHE) != 0) {
+ || strcmp(cacheFileVersionBuffer, BINC_CACHE) != 0)
+ {
// bump cache
fclose(fp);
uidvalidity = time(0);
@@ -68,8 +70,7 @@ Maildir::ReadCacheResult Maildir::readCache(void)
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) {
// error in input
fclose(fp);
uidvalidity = time(0);
@@ -88,7 +89,7 @@ Maildir::ReadCacheResult Maildir::readCache(void)
// skip consecutive white space
while (flagStart && *flagStart == ' ')
- ++flagStart;
+ ++flagStart;
}
// get flags
@@ -104,7 +105,7 @@ Maildir::ReadCacheResult Maildir::readCache(void)
// skip consecutive white space
while (flagStart && *flagStart != '\0' && *flagStart == ' ')
- ++flagStart;
+ ++flagStart;
}
MaildirMessage m(*this);
@@ -112,11 +113,10 @@ Maildir::ReadCacheResult Maildir::readCache(void)
m.setInternalDate(readInternalDate);
if (index.find(readUnique) == 0) {
- for (vector<string>::const_iterator it = customFlags.begin();
- it != customFlags.end(); ++it) {
- string tmpFlag = *it;
- trim(tmpFlag, " \n");
- m.setCustomFlag(tmpFlag);
+ for (vector<string>::const_iterator it = customFlags.begin(); it != customFlags.end(); ++it) {
+ string tmpFlag = *it;
+ trim(tmpFlag, " \n");
+ m.setCustomFlag(tmpFlag);
}
m.setUID(readUID);
@@ -134,8 +134,7 @@ Maildir::ReadCacheResult Maildir::readCache(void)
sort(customFlags.begin(), customFlags.end());
if (oldCustomFlags != customFlags) {
existingMessage.resetCustomFlags();
- for (vector<string>::const_iterator it = customFlags.begin();
- it != customFlags.end(); ++it) {
+ for (vector<string>::const_iterator it = customFlags.begin(); it != customFlags.end(); ++it) {
string tmpFlag = *it;
trim(tmpFlag, " \n");
existingMessage.setCustomFlag(tmpFlag);
@@ -148,4 +147,3 @@ Maildir::ReadCacheResult Maildir::readCache(void)
return Ok;
}
-