summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-24 00:12:54 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-24 00:12:54 +0800
commitefb5a6333d3fe1b4e9f3c744d6be6aaab27504e9 (patch)
treeaa3e9d28823a9d1a0d534a1db9e9c056e4357608
parent876e06732592fefb6ac7fb9d4530105ad29045ff (diff)
downloadpttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar.gz
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar.bz2
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar.lz
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar.xz
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.tar.zst
pttbbs-efb5a6333d3fe1b4e9f3c744d6be6aaab27504e9.zip
fix the problem of black hole
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1602 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c12
-rw-r--r--mbbsd/read.c18
-rw-r--r--mbbsd/record.c9
3 files changed, 29 insertions, 10 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 7617d35f..e5e4dbeb 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -105,7 +105,7 @@ save_violatelaw()
* void make_blist() { CreateNameList(); apply_boards(g_board_names); }
*/
-static time_t board_note_time;
+static time_t *board_note_time;
void
set_board()
@@ -118,7 +118,7 @@ set_board()
u_exit("access control violation!");
exit(-1);
}
- board_note_time = bp->bupdate;
+ board_note_time = &bp->bupdate;
if(bp->BM[0] <= ' ')
strcpy(currBM, "¼x¨D¤¤");
else
@@ -2625,10 +2625,12 @@ Read()
setutmpmode(READING);
set_board();
- if (board_visit_time < board_note_time) {
+ if (board_visit_time < *board_note_time) {
setbfile(buf, currboard, fn_notes);
- more(buf, NA);
- pressanykey();
+ if(more(buf, NA)!=-1)
+ pressanykey();
+ else
+ *board_note_time=0;
}
setutmpbid(currbid);
setbdir(buf, currboard);
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 1c2e5de1..47c63c3c 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -891,14 +891,26 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey
}
#if DIRCACHESIZE
if( bidcache > 0 &&
- !(currmode & (MODE_SELECT | MODE_DIGEST)) &&
- (last_line - recbase) < DIRCACHESIZE )
- entries = get_fileheader_cache(currbid, currdirect,
+ !(currmode & (MODE_SELECT | MODE_DIGEST)))
+ {
+ if((last_line - recbase) < DIRCACHESIZE )
+ entries = get_fileheader_cache(currbid, currdirect,
headers, recbase, p_lines);
+ else
+ entries = get_records(currdirect, headers, FHSZ,
+ recbase, p_lines);
+ if (entries < 0)
+ {
+ setbtotal(currbid);
+ last_line = getbtotal(currbid);
+ }
+ }
else
#endif
entries = get_records(currdirect, headers, FHSZ, recbase,
p_lines);
+
+
}
if (locmem->crs_ln > last_line)
locmem->crs_ln = last_line;
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 924f1449..64488842 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -555,14 +555,19 @@ stamplink(char *fpath, fileheader_t * fh)
int
do_append(char *fpath, fileheader_t * record, int size)
{
- int fd;
+ int fd, fsize=0;
+ struct stat st;
if ((fd = open(fpath, O_WRONLY | O_CREAT, 0644)) == -1) {
perror("open");
return -1;
}
flock(fd, LOCK_EX);
- lseek(fd, 0, SEEK_END);
+
+ if(fstat(fd, &st) )
+ fsize = st.st_size;
+
+ lseek(fd, (fsize / size) * size, SEEK_CUR); // avoid offset
safewrite(fd, record, size);