summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/admin.c14
-rw-r--r--mbbsd/board.c18
2 files changed, 16 insertions, 16 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index bdbae30a..38032f5f 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -605,9 +605,7 @@ m_newbrd(int recover)
setbpath(genbuf, newboard.brdname);
if (recover) {
- struct stat sb;
-
- if (stat(genbuf, &sb) == -1 || !(sb.st_mode & S_IFDIR)) {
+ if (dashd(genbuf)) {
outs("此看板已經存在! 請取不同英文板名");
pressanykey();
return -1;
@@ -682,15 +680,19 @@ int make_symbolic_link(int gid, int bid)
stand_title("建立看板連結");
memset(&newboard, 0, sizeof(newboard));
+ strlcpy(newboard.brdname, "1SYMLINK", sizeof(newboard.brdname));
newboard.gid = gid;
+ newboard.nuser = bid;
newboard.brdattr = BRD_NOTRAN | BRD_SYMBOLIC;
- if (append_record(fn_board, (fileheader_t *) & newboard, sizeof(newboard)) == -1) {
- vmsg("看板連結建來失敗");
+ if ((bid = getbnum("")) > 0) {
+ substitute_record(fn_board, &newboard, sizeof(newboard), bid);
+ reset_board(bid);
+ } else if (append_record(fn_board, (fileheader_t *) & newboard, sizeof(newboard)) == -1) {
+ vmsg("看板連結建立失敗");
return -1;
} else {
addbrd_touchcache();
}
- pressanykey();
return 0;
}
diff --git a/mbbsd/board.c b/mbbsd/board.c
index fe2d2a4e..66451224 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -609,11 +609,6 @@ load_boards(char *key)
(key[0] && !strcasestr(bptr->title, key)) ||
(class_bid == -1 && bptr->nuser < 5))
continue;
- if (bptr->brdattr & BRD_SYMBOLIC) {
- bptr = SYM2TAR_BH(bptr);
- n = SYM2TAR_UID(n + 1) - 1;
- // "state" is set since B_BH get the target stuff
- }
addnewbrdstat(n, state);
}
#ifdef CRITICAL_MEMORY
@@ -636,6 +631,11 @@ load_boards(char *key)
|| (yank_flag == 0 && !(getbrdattr(n) & PBS_FAV)) ||
(key[0] && !strcasestr(bptr->title, key)))
continue;
+ if (bptr->brdattr & BRD_SYMBOLIC) {
+ bptr = SYM2TAR_BH(bptr);
+ n = SYM2TAR_UID(n + 1) - 1;
+ // "state" is set since B_BH get the target stuff
+ }
addnewbrdstat(n, state);
}
byMALLOC = 0;
@@ -1143,8 +1143,8 @@ choose_board(int newflag)
brdnum = -1;
}
break;
- case Ctrl('L'):
- if (HAS_PERM(PERM_SYSOP) && yank_flag) {
+ case 'L':
+ if (HAS_PERM(PERM_SYSOP) && class_bid > 0) {
tmp = generalnamecomplete("請輸入看板英文名稱:",
buf, sizeof(buf),
SHM->Bnumber,
@@ -1156,9 +1156,7 @@ choose_board(int newflag)
brdnum = -1;
head = 9999;
}
- break;
- case 'L':
- if (HAS_PERM(PERM_BASIC) && yank_flag == 0) {
+ else if (HAS_PERM(PERM_BASIC) && yank_flag == 0) {
if (fav_add_line() == NULL) {
vmsg("新增失敗,分隔線/總最愛 數量達最大值。");
break;