diff options
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; } |