summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c5
-rw-r--r--mbbsd/cache.c17
-rw-r--r--mbbsd/read.c1
3 files changed, 18 insertions, 5 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 013616d1..8c7b432b 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2325,8 +2325,8 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct)
setbfile(buf, currboard, ".BOTTOM");
num = get_num_records(buf, sizeof(fileheader_t));
if(getans(fhdr->filemode & FILE_BOTTOM ?
- "¨ú®ø­«­n¤½½?(y/N)":
- "¥[¤J­«­n¤½§i?(y/N)")!='y') return READ_REDRAW;
+ "¨ú®ø¸m©³¤½½§i?(y/N)":
+ "¥[¤J¸m©³¤½§i?(y/N)")!='y') return READ_REDRAW;
fhdr->filemode ^= FILE_BOTTOM;
if(fhdr->filemode & FILE_BOTTOM)
{
@@ -2349,6 +2349,7 @@ push_bottom(int ent, fileheader_t * fhdr, char *direct)
delete_record(buf, sizeof(fileheader_t), i+1);
}
}
+ setbottomtotal(currbid);
substitute_record(direct, fhdr, sizeof(fileheader_t), ent);
return READ_REDRAW;
}
diff --git a/mbbsd/cache.c b/mbbsd/cache.c
index 21319c8e..465a4195 100644
--- a/mbbsd/cache.c
+++ b/mbbsd/cache.c
@@ -698,8 +698,21 @@ getbtotal(int bid)
{
return SHM->total[bid - 1];
}
+int
+getbottomtotal(int bid)
+{
+ return SHM->n_bottom[bid-1];
+}
void
+setbottomtotal(int bid)
+{
+ boardheader_t *bh = getbcache(bid);
+ char genbuf[256];
+ setbfile(genbuf, bh->brdname, ".BOTTOM");
+ SHM->n_bottom[bid-1]=get_num_records(genbuf, sizeof(fileheader_t));
+}
+void
setbtotal(int bid)
{
boardheader_t *bh = getbcache(bid);
@@ -707,9 +720,7 @@ setbtotal(int bid)
char genbuf[256];
int num, fd;
- snprintf(genbuf, sizeof(genbuf),
- "boards/%c/%s/.DIR", bh->brdname[0], bh->brdname);
-
+ setbfile(genbuf, bh->brdname, ".DIR");
if ((fd = open(genbuf, O_RDWR)) < 0)
return; /* .DIR±¾¤F */
fstat(fd, &st);
diff --git a/mbbsd/read.c b/mbbsd/read.c
index f6b64313..fb3e15d2 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -819,6 +819,7 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
if (bidcache > 0 && !(currmode & (MODE_SELECT | MODE_DIGEST))){
if( (last_line = getbtotal(currbid)) == 0 ){
setbtotal(currbid);
+ setbottomtotal(currbid);
last_line = get_num_records(currdirect, FHSZ);
}
}