From 1978b28e64d69265501bf7bb61a5396d5b140d8c Mon Sep 17 00:00:00 2001 From: ptt Date: Wed, 7 Apr 2004 21:46:10 +0000 Subject: push_bottom fix git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1720 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 6 ++++-- mbbsd/cache.c | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 01af29c6..1dc69c18 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -173,7 +173,9 @@ readdoent(int num, fileheader_t * ent) if ((currmode & MODE_BOARD) && (ent->filemode & FILE_DIGEST)) type = (type == ' ') ? '*' : '#'; else if (currmode & MODE_BOARD || HAS_PERM(PERM_LOGINOK)) { - if (ent->filemode & FILE_MARKED) + if (ent->filemode & FILE_BOTTOM) + type = '_' ; + else if (ent->filemode & FILE_MARKED) type = (type == ' ') ? 'm' : 'M'; else if (TagNum && !Tagger(atoi(ent->filename + 2), 0, TAG_NIN)) @@ -2352,7 +2354,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct) } setbottomtotal(currbid); substitute_record(direct, fhdr, sizeof(fileheader_t), ent); - return READ_REDRAW; + return DIRCHANGED; } static int diff --git a/mbbsd/cache.c b/mbbsd/cache.c index e76110b8..494f3f27 100644 --- a/mbbsd/cache.c +++ b/mbbsd/cache.c @@ -523,6 +523,11 @@ load_fileheader_cache(int bid, char *direct) int num = getbtotal(bid), n_bottom = getbottomtotal(bid); int n = num - DIRCACHESIZE + n_bottom + 1; int dirsize = DIRCACHESIZE-n_bottom; + if (n<1) + { + n=1; + dirsize=num; + } if (SHM->Bbusystate != 1 && COMMON_TIME - SHM->busystate_b[bid - 1] >= 10) { SHM->busystate_b[bid - 1] = COMMON_TIME; if(n_bottom) @@ -533,7 +538,7 @@ load_fileheader_cache(int bid, char *direct) sizeof(fileheader_t), 1, n_bottom); } get_records(direct, SHM->dircache[bid - 1], - sizeof(fileheader_t), n < 1 ? 1 : n, dirsize); + sizeof(fileheader_t), n, dirsize); SHM->busystate_b[bid - 1] = 0; } else { safe_sleep(1); -- cgit v1.2.3