diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-16 11:57:23 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-16 11:57:23 +0800 |
commit | 0bd90a389d5c86f0aa255ce6dbff8c6669529457 (patch) | |
tree | 2a9d99f4800af6a0c4f805144e2bff50165733df | |
parent | 2cf81a3c572cb71202ca492d11f7ce6b0400fc2f (diff) | |
download | pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar.gz pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar.bz2 pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar.lz pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar.xz pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.tar.zst pttbbs-0bd90a389d5c86f0aa255ce6dbff8c6669529457.zip |
push bottom fix
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1768 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 1 | ||||
-rw-r--r-- | mbbsd/cache.c | 11 |
2 files changed, 11 insertions, 1 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 7d9b75d9..4343cccb 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -2319,6 +2319,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct) char buf[256]; if ((currmode & MODE_DIGEST) || !(currmode & MODE_BOARD)) return DONOTHING; + setbottomtotal(currbid); // Ptt : will be remove when stable num = getbottomtotal(currbid); if(getans(fhdr->filemode & FILE_BOTTOM ? "¨ú®ø¸m©³¤½§i?(y/N)": diff --git a/mbbsd/cache.c b/mbbsd/cache.c index 0d542ba5..b7ecb0be 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -655,8 +655,17 @@ setbottomtotal(int bid) { boardheader_t *bh = getbcache(bid); char genbuf[256]; + int n; setbfile(genbuf, bh->brdname, ".DIR.bottom"); - SHM->n_bottom[bid-1]=get_num_records(genbuf, sizeof(fileheader_t)); + n = get_num_records(genbuf, sizeof(fileheader_t)); + if(n>5) + { + log_file("push_bottom.fix", genbuf, 1); + unlink(genbuf); + SHM->n_bottom[bid-1]=0; + } + else + SHM->n_bottom[bid-1]=n; } void setbtotal(int bid) |