From 20b85c03e751b4876fa3c92040464e483172b746 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 19:03:11 +0200 Subject: manual format adjustment --- src/maildir.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/maildir.c') 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; } -- cgit v1.2.3