diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-08 12:37:26 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-11-08 12:37:26 +0800 |
commit | cb6e03a922afbbaeddd84dd59eb5eda40c58fb60 (patch) | |
tree | bc9f2479863dde057fc632b1fc34b3773af14c33 | |
parent | f148c34c59a8faba2b79f2144347e435e35a56b3 (diff) | |
download | pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar.gz pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar.bz2 pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar.lz pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar.xz pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.tar.zst pttbbs-cb6e03a922afbbaeddd84dd59eb5eda40c58fb60.zip |
fix moving error
git-svn-id: http://opensvn.csie.org/pttbbs/branches/victor.fav4.bak@1307 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/fav.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/pttbbs/mbbsd/fav.c b/pttbbs/mbbsd/fav.c index 3d9e7c9b..9fff5f59 100644 --- a/pttbbs/mbbsd/fav.c +++ b/pttbbs/mbbsd/fav.c @@ -328,7 +328,7 @@ void fav_folder_out(void) } /* cursor never on an unvisable entry */ -inline static int is_visible_item(fav_type_t *ft){ +inline int is_visible_item(fav_type_t *ft){ if (!(ft->attr & FAVH_FAV)) return 0; if (get_item_type(ft) != FAVT_BOARD) @@ -648,20 +648,13 @@ static void move_in_folder(fav_t *fav, int from, int to) fav_item_copy(&tmp, &fav->favh[from]); - count = 0; if (from < to) { - for(i = from; from + count < to; i++){ + for(i = from; i < to; i++) fav_item_copy(&fav->favh[i], &fav->favh[i + 1]); - if (is_visible_item(&fav->favh[i])) - count++; - } } else { // to < from - for(i = from; from - count > to; i--){ + for(i = from; i > to; i--) fav_item_copy(&fav->favh[i], &fav->favh[i - 1]); - if (is_visible_item(&fav->favh[i])) - count++; - } } fav_item_copy(&fav->favh[to], &tmp); } |