diff options
author | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 19:03:11 +0200 |
---|---|---|
committer | Jannis Hoffmann <jannis@fehcom.de> | 2024-07-03 19:03:11 +0200 |
commit | 20b85c03e751b4876fa3c92040464e483172b746 (patch) | |
tree | 734fadbfdbc143ec4465093857f4c239448715e0 /src/maildir.c | |
parent | a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f (diff) |
manual format adjustment
Diffstat (limited to 'src/maildir.c')
-rw-r--r-- | src/maildir.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/maildir.c b/src/maildir.c index c360bc2..a755177 100644 --- a/src/maildir.c +++ b/src/maildir.c @@ -66,12 +66,13 @@ static int append(prioq *pq, stralloc *filenames, char *subdir, datetime_sec tim if (!stralloc_cats(filenames, "/")) break; if (!stralloc_cats(filenames, d->d_name)) break; if (!stralloc_0(filenames)) break; - if (stat(filenames->s + pos, &st) == 0) + if (stat(filenames->s + pos, &st) == 0) { if (st.st_mtime < time) { /* don't want to mix up the order */ pe.dt = st.st_mtime; pe.id = pos; if (!prioq_insert(pq, &pe)) break; } + } } closedir(dir); @@ -89,9 +90,7 @@ int maildir_scan(prioq *pq, stralloc *filenames, int flagnew, int flagcur) time = now(); - if (flagnew) - if (append(pq, filenames, "new", time) == -1) return -1; - if (flagcur) - if (append(pq, filenames, "cur", time) == -1) return -1; + if (flagnew && append(pq, filenames, "new", time) == -1) return -1; + if (flagcur && append(pq, filenames, "cur", time) == -1) return -1; return 0; } |