diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 18:29:43 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-08-09 18:29:43 +0800 |
commit | 6ac040991381bae9a499506bfb7538bca8191ece (patch) | |
tree | 19f264e78bde30dd0fa0b14208117095536ba099 /mbbsd/board.c | |
parent | 01ae376a8e5736c8b754e85666280ab16f26314f (diff) | |
download | pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar.gz pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar.bz2 pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar.lz pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar.xz pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.tar.zst pttbbs-6ac040991381bae9a499506bfb7538bca8191ece.zip |
fav.c: don't delete a fav entry implicitly
board.c: make data flow analysis easier to compiler
admin.c: pretty delete description
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3019 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/board.c')
-rw-r--r-- | mbbsd/board.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 01a529cb..cd7aed81 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -234,16 +234,10 @@ cmpboardfriends(const void *brd, const void *tmp) static void load_boards(char *key) { - boardheader_t *bptr = NULL; int type = cuser.uflag & BRDSORT_FLAG ? 1 : 0; - int i, n, bid; + int i; int state; - if (IN_CLASS()) { - bptr = getbcache(class_bid); - if (bptr->firstchild[type] == 0 ) - load_uidofgid(class_bid, type); - } brdnum = 0; if (nbrd) { free(nbrd); @@ -269,7 +263,6 @@ load_boards(char *key) else if (get_item_type(&fav->favh[i]) == FAVT_FOLDER ) state = NBRD_FOLDER; else { - bptr = getbcache(fav_getid(&fav->favh[i])); state = NBRD_BOARD; if (is_set_attr(&fav->favh[i], FAVH_UNREAD)) state |= NBRD_UNREAD; @@ -286,7 +279,7 @@ load_boards(char *key) else continue; }else{ - bptr = getbcache(fav_getid(&fav->favh[i])); + boardheader_t *bptr = getbcache(fav_getid(&fav->favh[i])); if( HasBoardPerm(bptr) && strcasestr(bptr->title, key)) state = NBRD_BOARD; else @@ -319,8 +312,9 @@ load_boards(char *key) else { // general case nbrd = (boardstat_t *) malloc(sizeof(boardstat_t) * numboards); for (i = 0; i < numboards; i++) { - n = SHM->bsorted[type][i]; - if (n<0 || (bptr = &bcache[n]) == NULL) + int n = SHM->bsorted[type][i]; + boardheader_t *bptr = &bcache[n]; + if (n < 0 || bptr == NULL) continue; if (!bptr->brdname[0] || (bptr->brdattr & (BRD_GROUPBOARD | BRD_SYMBOLIC)) || @@ -339,7 +333,13 @@ load_boards(char *key) qsort(nbrd, brdnum, sizeof(boardstat_t), cmpboardfriends); #endif } else { /* load boards of a subclass */ - int childcount = bptr->childcount; + boardheader_t *bptr = getbcache(class_bid); + int childcount = bptr->childcount; + int bid; + + if (bptr->firstchild[type] == 0 ) + load_uidofgid(class_bid, type); + nbrd = (boardstat_t *) malloc((childcount+2) * sizeof(boardstat_t)); // 預留兩個以免大量開板時掛調 for (bid = bptr->firstchild[type]; bid > 0 && |