From 5113b19db65fb7cdc8966b30b99c32340f329353 Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 2 Dec 2007 15:39:25 +0000 Subject: - BRC v3: process special files better (which may share same create time with others and applying different modify time) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3616 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/brc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/brc.c b/mbbsd/brc.c index 7a965e33..dcfd89eb 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -507,7 +507,17 @@ brc_addlist(const char *fname, time4_t modified) return; for (n = 0; n < brc_num; n++) { /* using linear search */ if (frec.create == brc_list[n].create) { - if (brc_list[n].modified != modified) + // check if we got bad value. + if (modified == (time4_t)-1) + return; + + if (brc_list[n].modified == (time4_t)-1) + brc_list[n].modified = 0; + + // special case here: + // in order to support special system like 'always bottom', + // they may share same create time and different time. + if (brc_list[n].modified < modified) { brc_list[n].modified = modified; brc_changed = 1; @@ -563,7 +573,11 @@ brc_unread_time(int bid, time4_t ftime, time4_t modified) if (modified == (time4_t)-1 || brcm == (time4_t)-1) return 0; - return modified != brcm ? 2 : 0; + // one case is, some special file headers (ex, + // always bottom) may cause issue. They share create + // time (filename) and apply different modify time. + // so let's back to 'greater'. + return modified > brcm ? 2 : 0; } } return 0; -- cgit v1.2.3