diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-30 04:42:54 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-30 04:42:54 +0800 |
commit | f96e3fe469a9cf18c385e27297d987e80f5af0a5 (patch) | |
tree | cdf1ebfc936709efd116e3eeb448e487d639877a /mbbsd/read.c | |
parent | b46eb1e0f400514ca8fa7a761711040fdbd7dc6a (diff) | |
download | pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar.gz pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar.bz2 pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar.lz pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar.xz pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.tar.zst pttbbs-f96e3fe469a9cf18c385e27297d987e80f5af0a5.zip |
1.fix some bug for reference tag
2.add static _mode to cost down select_read's time.
Note: getindex is a bad!! funcation...must get ride of that some day.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1892 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/read.c')
-rw-r--r-- | mbbsd/read.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index a53be8b0..ab5307b5 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -300,7 +300,6 @@ thread(keeploc_t * locmem, int stypen) return new_ln; } - #ifdef INTERNET_EMAIL static void mail_forward(fileheader_t * fhdr, char *direct, int mode) @@ -336,6 +335,7 @@ select_read(keeploc_t * locmem, int sr_mode) char newdirect[MAXPATHLEN]; char keyword[TTLEN + 1] = ""; char genbuf[MAXPATHLEN], *p; + static int _mode = 0; int len, fd, fr, i, count=0, reference = 0; fileheader_t *fh = &headers[locmem->crs_ln - locmem->top_ln]; @@ -352,12 +352,22 @@ select_read(keeploc_t * locmem, int sr_mode) currmode & MODE_SELECT ? "增加條件 標題:":"搜尋標題:", keyword, TTLEN, DOECHO)) return READ_REDRAW; - log_file("keyword_search_log", 1, "%s:%s", currboard, keyword); +#ifdef KEYWORD_LOG + log_file("keyword_search_log", 1, "%s:%s\n", currboard, keyword); +#endif } - else if(sr_mode & RS_TITLE) + else + { + if(_mode & sr_mode & (RS_TITLE | RS_NEWPOST)) return DONOTHING; + // Ptt: only once for these two modes. + if(sr_mode & RS_TITLE) strcpy(keyword, subject(fh->title)); + } - p = strstr(currdirect, "SR"); + if((p = strstr(currdirect, "SR"))==NULL) + _mode = sr_mode; + else + _mode |= sr_mode; snprintf(genbuf, sizeof(genbuf), "%s.%X.%X.%X", p ? p : "SR", @@ -370,7 +380,7 @@ select_read(keeploc_t * locmem, int sr_mode) else setbfile(newdirect, currboard, genbuf); - if( !(now - dasht(newdirect) > 600) ) + if( now - dasht(newdirect) < 1200 ) count = dashs(newdirect); else { if( (fd = open(newdirect, O_CREAT | O_RDWR, 0600)) == -1 ) |