diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-25 08:51:09 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-25 08:51:09 +0800 |
commit | 222cc56e375934b18a4fc886ca3a769e4df58f73 (patch) | |
tree | 38306135c2bdb3815a3ba48376b86fc311103579 | |
parent | d5f6cda0c60bbb2dbe4b57eca207b83696178dca (diff) | |
download | pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar.gz pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar.bz2 pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar.lz pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar.xz pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.tar.zst pttbbs-222cc56e375934b18a4fc886ca3a769e4df58f73.zip |
debug of read.c
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1848 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/read.c | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index cb0a8467..b059ffac 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -3,7 +3,6 @@ static fileheader_t *headers = NULL; static int last_line; // PTT: last_line 游標可指的最後一個 -static int hit_thread; #include <sys/mman.h> @@ -259,7 +258,6 @@ cursor_pos(keeploc_t * locmem, int val, int from_top) return PARTUPDATE; } - static int thread(keeploc_t * locmem, int stype, int *new_ln) { @@ -271,7 +269,7 @@ thread(keeploc_t * locmem, int stype, int *new_ln) int circulate_flag = 1; /* circulate at end or begin */ int fd = -1; - match = hit_thread = 0; + match = 0; now = pos = locmem->crs_ln; if (stype == 'A') { if (!*currowner) @@ -287,18 +285,6 @@ thread(keeploc_t * locmem, int stype, int *new_ln) query = a_ans; circulate_flag = 0; stype = RS_FORWARD; - } else if (stype == '/') { - if (!*t_ans) - return DONOTHING; - query = t_ans; - circulate_flag = 0; - stype = RS_TITLE | RS_FORWARD; - } else if (stype == '?') { - if (!*t_ans) - return DONOTHING; - circulate_flag = 0; - query = t_ans; - stype = RS_TITLE; } else if (stype & RS_RELATED) { tag = headers[pos - locmem->top_ln].title; if (stype & RS_CURRENT) { @@ -348,7 +334,6 @@ thread(keeploc_t * locmem, int stype, int *new_ln) if( fd ) close(fd); if ((stype & RS_FIRST) && (near)) { - hit_thread = 1; *new_ln = near; } return DONOTHING; @@ -369,7 +354,6 @@ thread(keeploc_t * locmem, int stype, int *new_ln) if (stype & RS_THREAD) { if (strncasecmp(fh.title, str_reply, 3)) { - hit_thread = 1; if( fd ) close(fd); *new_ln = now; @@ -388,7 +372,6 @@ thread(keeploc_t * locmem, int stype, int *new_ln) near = now; continue; } - hit_thread = 1; *new_ln = now; if ((!(stype & RS_CURRENT)) && (stype & RS_RELATED) && @@ -815,7 +798,6 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey char currdirect0[64], default_ch = 0; int last_line0 = last_line; int bottom_line = 0; - int hit_thread0 = hit_thread; fileheader_t *headers0 = headers; strlcpy(currdirect0, currdirect, sizeof(currdirect0)); @@ -921,19 +903,24 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey mode = cursor_pos(locmem, locmem->crs_ln + 1, 10); break; case RELATE_PREV: - mode = thread(locmem, RELATE_PREV, &locmem->crs_ln); + thread(locmem, RELATE_PREV, &num); + mode = cursor_pos(locmem, num, 10); break; case RELATE_NEXT: - mode = thread(locmem, RELATE_NEXT, &locmem->crs_ln); + thread(locmem, RELATE_NEXT, &num); + mode = cursor_pos(locmem, num, 10); break; case RELATE_FIRST: - mode = thread(locmem, RELATE_FIRST, &locmem->crs_ln); + thread(locmem, RELATE_FIRST, &num); + mode = cursor_pos(locmem, num, 10); break; case 'A': - mode = thread(locmem, 'A', &locmem->crs_ln); + thread(locmem, 'A', &num); + mode = cursor_pos(locmem, num, 10); break; case 'a': - mode = thread(locmem, 'a', &locmem->crs_ln); + thread(locmem, 'a', &num); + mode = cursor_pos(locmem, num, 10); break; } if(locmem->crs_ln != last_ln) default_ch = 'r'; @@ -944,7 +931,6 @@ i_read(int cmdmode, char *direct, void (*dotitle) (), void (*doentry) (), onekey free(headers); last_line = last_line0; - hit_thread = hit_thread0; headers = headers0; strlcpy(currdirect, currdirect0, sizeof(currdirect)); return; |