diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 23:37:05 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-13 23:37:05 +0800 |
commit | 346efecb76f32b8e76732b45304cd7800a08d6e4 (patch) | |
tree | c9ae0545e58e2eaa978f9c45629fd7d1622966a0 | |
parent | a1e7b5668d77a5930d09f6ed39099c87e781f829 (diff) | |
download | pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar.gz pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar.bz2 pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar.lz pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar.xz pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.tar.zst pttbbs-346efecb76f32b8e76732b45304cd7800a08d6e4.zip |
* fix bug of r4586: leave board. I feel this is a dirty fix..
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4597 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/board.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 618711ce..ef872776 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -120,6 +120,18 @@ 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) { @@ -1642,6 +1654,7 @@ 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 @@ -1664,6 +1677,11 @@ 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); } @@ -1705,6 +1723,7 @@ 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); if (newflag) { @@ -1715,6 +1734,10 @@ choose_board(int newflag) } 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); |