summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-27 20:34:28 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-27 20:34:28 +0800
commit0efa8ac69be55f6533b48504ac1eb4f66ffd1dec (patch)
tree0d9e578a9e15318733e9d6b8a0920e1740ae50cc
parentf06c7aa81c50445045bc1215bab42bf7839648c5 (diff)
downloadpttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar.gz
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar.bz2
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar.lz
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar.xz
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.tar.zst
pttbbs-0efa8ac69be55f6533b48504ac1eb4f66ffd1dec.zip
leave board if brc_buf is not loaded
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1614 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/bbs.c4
-rw-r--r--mbbsd/board.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 0c0a5220..ac8993b8 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2621,6 +2621,10 @@ Read()
#ifdef LOG_BOARD
time_t usetime = now;
#endif
+ extern char *brc_buf;
+
+ if( !brc_buf )
+ return 0;
setutmpmode(READING);
set_board();
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 68c5603b..c02ca00d 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -55,7 +55,7 @@ brc_putrecord(char *ptr, const char *name, int num, const int *list)
static int brc_changed = 0;
/* The below two will be filled by read_brc_buf() and brc_update() */
-static char *brc_buf = NULL;
+char *brc_buf = NULL;
static int brc_size;
static char * const fn_boardrc = ".boardrc";
@@ -150,7 +150,8 @@ brc_finalize(){
int fd;
brc_update();
setuserfile(brcfile, fn_boardrc);
- if ((fd = open(brcfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) != -1) {
+ if (brc_buf != NULL &&
+ (fd = open(brcfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) != -1) {
write(fd, brc_buf, brc_size);
close(fd);
}