diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-03-28 21:32:02 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-03-28 21:32:02 +0800 |
commit | a3aa2fb84feac7c8f0dca9ec0542accfa0feca96 (patch) | |
tree | 281aa8a851fb4889a245b896d048f8592e807871 /mbbsd | |
parent | b32fc4a1d9b50c04fb02806b40d22c10175694d7 (diff) | |
download | pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar.gz pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar.bz2 pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar.lz pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar.xz pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.tar.zst pttbbs-a3aa2fb84feac7c8f0dca9ec0542accfa0feca96.zip |
remove duplication favorite entry
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@738 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/board.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c index 40826a4c..a929fe99 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1,4 +1,4 @@ -/* $Id: board.c,v 1.111 2003/03/27 19:50:28 in2 Exp $ */ +/* $Id: board.c,v 1.112 2003/03/28 13:32:02 in2 Exp $ */ #include "bbs.h" #define BRC_STRLEN 15 /* Length of board name */ #define BRC_MAXSIZE 24576 @@ -480,13 +480,21 @@ void load_brdbuf(void) } // check if fav is correct + // 'r' for current reading position, 'w' for current writing position + // 'i' for checking duplication for( r = w = 0 ; r < fav->nDatas ; ++r ) - if( fav->b[r].attr & BRD_FAV ) // 須是 BRD_FAV - if( (fav->b[r].bid < 0) || // 分隔線 - (fav->b[r].bid > 0 && // bid > 0 且該看板存在 + if( fav->b[r].attr & BRD_FAV ) // 須是 BRD_FAV + if( (fav->b[r].bid < 0) || // 分隔線 + (fav->b[r].bid > 0 && // bid 在合理範圍 fav->b[r].bid < numboards && - bcache[fav->b[r].bid - 1].brdname[0]) ) - fav->b[w++] = fav->b[r]; + bcache[fav->b[r].bid - 1].brdname[0]) ){ // 看板存在 + int i; + for( i = 0 ; i < w ; ++i ) + if( fav->b[i].bid == fav->b[r].bid ) + break; + if( i == w ) // 無和之前的重覆 + fav->b[w++] = fav->b[r]; + } fav->nDatas = w; updatenewfav(1); |