From f1f9c20bd8d9d175f8db73b062a60a9f79e95a7e Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 11 Jun 2021 17:32:18 -0400 Subject: 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. --- concat.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'concat.c') 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); -- cgit 1.4.1