summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 23:39:25 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-02 23:39:25 +0800
commit5113b19db65fb7cdc8966b30b99c32340f329353 (patch)
tree2ad325c5103273b2d7ed079d08f7251a357bf9c6 /mbbsd
parent5d817896fe6615f9fce03695263c111fd41ed9e3 (diff)
downloadpttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar.gz
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar.bz2
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar.lz
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar.xz
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.tar.zst
pttbbs-5113b19db65fb7cdc8966b30b99c32340f329353.zip
- 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
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/brc.c18
1 files changed, 16 insertions, 2 deletions
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;