summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}