summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-18 13:22:47 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-18 13:22:47 +0800
commitce3b6974793db3c2d95e5f4c88a45af377985a54 (patch)
treead3eac98f8b4bac11ece18c889ab1c4eb259cdab
parente89db4fe4cc15f85de1da9b1b65fc87a77a0c594 (diff)
downloadpttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar.gz
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar.bz2
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar.lz
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar.xz
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.tar.zst
pttbbs-ce3b6974793db3c2d95e5f4c88a45af377985a54.zip
D: delete symlink
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1777 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/admin.c13
-rw-r--r--mbbsd/board.c13
2 files changed, 13 insertions, 13 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 88d3f181..5abb39da 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -258,6 +258,14 @@ setup_man(boardheader_t * board)
mkdir(genbuf, 0755);
}
+void delete_symbolic_link(boardheader_t *bh, int bid)
+{
+ memset(&bh, 0, sizeof(bh));
+ substitute_record(fn_board, &bh, sizeof(bh), bid);
+ reset_board(bid);
+ log_usies("DelLink", bh->brdname);
+}
+
int
m_mod_board(char *bname)
{
@@ -337,10 +345,7 @@ m_mod_board(char *bname)
if (genbuf[0] != 'y' || !bname[0])
outs(MSG_DEL_CANCEL);
else if (bh.brdattr & BRD_SYMBOLIC) {
- memset(&bh, 0, sizeof(bh));
- substitute_record(fn_board, &bh, sizeof(bh), bid);
- reset_board(bid);
- log_usies("DelLink", bh.brdname);
+ delete_symbolic_link(&bh, bid);
}
else {
strlcpy(bname, bh.brdname, sizeof(bh.brdname));
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 66644967..bfc602ed 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -805,6 +805,10 @@ choose_board(int newflag)
yank_flag = (yank_flag + 1) % 2;
brdnum = -1;
break;
+ case 'D':
+ ptr = &nbrd[num];
+ delete_symbolic_link(&bcache[ptr->bid - 1], ptr->bid);
+ break;
case Ctrl('D'):
if (HAS_PERM(PERM_LOGINOK)) {
fav_remove_all_tagged_item();
@@ -977,15 +981,6 @@ choose_board(int newflag)
if (HAS_PERM(PERM_LOGINOK))
vmsg("嘿嘿 這個功\能已經被我的最愛取代掉了喔!");
break;
-#ifdef DEBUG
- case 'A':
- if (1) {
- char genbuf[200];
- sprintf(genbuf, "brdnum: %d num: %d", brdnum, num);
- vmsg(genbuf);
- }
- break;
-#endif
case 'Z':
if (HAS_PERM(PERM_LOGINOK)) {
char genbuf[256];