diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 02:14:11 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 02:14:11 +0800 |
commit | 1e74218f83c72175954f25bff7ba13b78119a863 (patch) | |
tree | 3b49350ce20c49e55b80ecdea9fea7277543faf6 /mbbsd/board.c | |
parent | 25d3eb59e94d5844209f7d401802f0f72c5c8ea6 (diff) | |
download | pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar.gz pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar.bz2 pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar.lz pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar.xz pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.tar.zst pttbbs-1e74218f83c72175954f25bff7ba13b78119a863.zip |
* revert r4584, r4586, r4595: to preserve old behavior.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4628 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r-- | mbbsd/board.c | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index d199dc46..8f8f2dc5 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -74,8 +74,8 @@ inline boardheader_t *getparent(const boardheader_t *fh) * -2 permission denied * -3 error * @note enter board: - * 1. setup brc - * 2. set currbid, currboard, currbrdattr, currBM, currmode, currdirect + * 1. setup brc (currbid, currboard, currbrdattr) + * 2. set currbid, currBM, currmode, currdirect * 3. utmp brc_id */ int enter_board(const char *boardname) @@ -107,10 +107,7 @@ int enter_board(const char *boardname) /* really enter board */ brc_update(); - brc_initial_board(bid); - currbid = bid; - currboard = bcache[currbid - 1].brdname; - currbrdattr = bcache[currbid - 1].brdattr; + brc_initial_board(bname); setutmpbid(currbid); set_board(); @@ -120,18 +117,6 @@ int enter_board(const char *boardname) return 0; } -/* - * leave_board 會變成不在任何看板內, 並不會返回前看板. - * 因此 enter_board 跟 leave_board 不需要成對. - */ -void leave_board() -{ - currbid = 0; - currboard = ""; - currbrdattr = 0; - setutmpbid(0); - currmode &= MODE_STARTED | MODE_DIRTY; -} static void imovefav(int old) { @@ -1103,7 +1088,7 @@ unread_position(char *dirfile, boardstat_t * ptr) total = B_TOTAL(ptr); num = total + 1; if ((ptr->myattr & NBRD_UNREAD) && (fd = open(dirfile, O_RDWR)) > 0) { - if (!brc_initial_board(ptr->bid)) { + if (!brc_initial_board(B_BH(ptr)->brdname)) { num = 1; } else { num = total - 1; @@ -1654,7 +1639,6 @@ choose_board(int newflag) case 's': { char bname[IDLEN+1]; - const char *bak_currboard = currboard; move(0, 0); clrtoeol(); // since now user can use Ctrl-S to get access @@ -1677,11 +1661,6 @@ choose_board(int newflag) // try to enter board directly. if(enter_board(bname) >= 0) Read(); - if (bak_currboard[0]) - enter_board(bak_currboard); - else - leave_board(); - // restore my mode setutmpmode(newflag ? READNEW : READBRD); } @@ -1723,21 +1702,15 @@ choose_board(int newflag) assert(0<=ptr->bid-1 && ptr->bid-1<MAX_BOARD); if (!(B_BH(ptr)->brdattr & BRD_GROUPBOARD)) { /* 非sub class */ if (HasBoardPerm(B_BH(ptr))) { - const char *bak_currboard = currboard; - brc_initial_board(ptr->bid); + brc_initial_board(B_BH(ptr)->brdname); if (newflag) { - setbdir(buf, B_BH(ptr)->brdname); + setbdir(buf, currboard); tmp = unread_position(buf, ptr); head = tmp - t_lines / 2; getkeep(buf, head > 1 ? head : 1, tmp + 1); } - enter_board(B_BH(ptr)->brdname); Read(); - if (bak_currboard[0]) - enter_board(bak_currboard); - else - leave_board(); check_newpost(ptr); head = -1; setutmpmode(newflag ? READNEW : READBRD); |