diff options
author | June McEnroe <june@causal.agency> | 2021-06-11 17:32:18 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-06-11 18:29:36 -0400 |
commit | f1f9c20bd8d9d175f8db73b062a60a9f79e95a7e (patch) | |
tree | c0db35013b96f6c6fd5322c5f058b681a790df0e /concat.c | |
parent | Generalize index.{atom,html} to search pages (diff) | |
download | bubger-f1f9c20bd8d9d175f8db73b062a60a9f79e95a7e.tar.gz bubger-f1f9c20bd8d9d175f8db73b062a60a9f79e95a7e.zip |
Generate arbitrary search pages and feeds
First export ALL threads, then generate search pages. Skip search threads that weren't exported by the ALL search, i.e. non-root threads.
Diffstat (limited to '')
-rw-r--r-- | concat.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/concat.c b/concat.c index 82f2c84..2b1c619 100644 --- a/concat.c +++ b/concat.c @@ -294,15 +294,13 @@ void concatSearch( if (!order) err(EX_OSERR, "calloc"); for (size_t i = 0; i < threads.len; ++i) { + order[i].index = i; + order[i].created = envelopes[i].time; + struct stat status; char *path = threadPath(envelopes[i].messageID, "html"); - int error = stat(path, &status); - if (error) err(EX_DATAERR, "%s", path); + if (!stat(path, &status)) order[i].updated = status.st_mtime; free(path); - - order[i].index = i; - order[i].created = envelopes[i].time; - order[i].updated = status.st_mtime; } qsort(order, threads.len, sizeof(*order), sortCompare); @@ -322,6 +320,7 @@ void concatSearch( if (error) err(EX_IOERR, "%s", path); for (size_t i = threads.len - 1; i < threads.len; --i) { + if (!order[i].updated) continue; const struct Envelope *envelope = &envelopes[order[i].index]; struct List thread = dataCheck(threads.ptr[order[i].index], List).list; error = htmlSearchThread(file, envelope, thread); |