diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-23 00:57:36 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-07-23 00:57:36 +0800 |
commit | 83431f2cd992c38eb2fbc3b5095c52034fd2ff3f (patch) | |
tree | 6ee954826c28f78a972cbd622ffa0ddb6586553c /mbbsd | |
parent | ecb8b2d326822691b2633451732f8d7685353383 (diff) | |
download | pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar.gz pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar.bz2 pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar.lz pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar.xz pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.tar.zst pttbbs-83431f2cd992c38eb2fbc3b5095c52034fd2ff3f.zip |
sync with PTT1 local modified source:
- debug with msgfwderr
- enlarge thread search range
- more verbose board info
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2942 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/mail.c | 37 | ||||
-rw-r--r-- | mbbsd/read.c | 23 |
2 files changed, 53 insertions, 7 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 59b1c30b..8d863d63 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -120,11 +120,42 @@ mail_id(const char *id, const char *title, const char *src, const char *owner) int invalidaddr(const char *addr) { +#ifdef DEBUG_FWDADDRERR + const char *origaddr = addr; + char errmsg[PATHLEN]; +#endif + if (*addr == '\0') return 1; /* blank */ + while (*addr) { +#ifdef DEBUG_FWDADDRERR if (not_alnum(*addr) && !strchr("[].@-_", *addr)) + { + int c = (*addr) & 0xff; + clear(); + move(2,0); + outs( + "您輸入的位址錯誤 (address error)。 \n\n" + "由於最近許\多人反應打入正確的位址(id或email)後系統會判斷錯誤\n" + "但檢查不出原因,所以我們需要正確的錯誤回報。\n\n" + "如果你確實打錯了,請直接略過下面的說明。\n" + "如果你認為你輸入的位址確實是對的,請把下面的訊息複製起來\n" + "並貼到 SYSOP 或 PttBug 板。本站為造成不便深感抱歉。\n\n" + ANSI_COLOR(1;33)); + sprintf(errmsg, "原始輸入位址: [%s]\n" + "錯誤位置: 第 %d 字元: 0x%02X [ %c ]\n", + origaddr, (int)(addr - origaddr+1), c, c); + outs(errmsg); + outs(ANSI_RESET); + vmsg("請按任意鍵繼續"); + clear(); return 1; + } +#else + if (not_alnum(*addr) && !strchr("[].@-_", *addr)) + return 1; +#endif addr++; } return 0; @@ -1607,10 +1638,10 @@ bsmtp(const char *fpath, const char *title, const char *rcpt, int method) int doforward(const char *direct, const fileheader_t * fh, int mode) { - static char address[60]; - char fname[500]; + static char address[STRLEN] = ""; + char fname[PATHLEN]; + char genbuf[PATHLEN]; int return_no; - char genbuf[200]; if (!address[0]) strlcpy(address, cuser.email, sizeof(address)); diff --git a/mbbsd/read.c b/mbbsd/read.c index 62d9acdb..0e9974e7 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -313,7 +313,7 @@ static int thread(const keeploc_t * locmem, int stypen) { fileheader_t fh; - int pos = locmem->crs_ln, jump = 200, new_ln; + int pos = locmem->crs_ln, jump = THREAD_SEARCH_RANGE, new_ln; int fd = -1, amatch = -1; int step = (stypen & RS_FORWARD) ? 1 : -1; char *key; @@ -336,7 +336,8 @@ thread(const keeploc_t * locmem, int stypen) break; else if( !strncmp(&fh.title[4], key, PROPER_TITLE_LEN) ) { amatch = new_ln; - jump = 200; /* 當搜尋同主題第一篇, 連續找不到 200 篇才停 */ + jump = THREAD_SEARCH_RANGE; + /* 當搜尋同主題第一篇, 連續找不到多少篇才停 */ } } else if( !strncmp(subject(fh.title), key, PROPER_TITLE_LEN) ) @@ -366,7 +367,8 @@ mail_forward(const fileheader_t * fhdr, const char *direct, int mode) char buf[STRLEN]; char *p; - strncpy(buf, direct, sizeof(buf)); + strncpy(buf, direct, sizeof(buf)-1); + buf[sizeof(buf)-1] = 0; if ((p = strrchr(buf, '/'))) *p = '\0'; switch (i = doforward(buf, fhdr, mode)) { @@ -377,7 +379,9 @@ mail_forward(const fileheader_t * fhdr, const char *direct, int mode) vmsg(msg_fwd_err1); break; case -2: +#ifndef DEBUG_FWDADDRERR vmsg(msg_fwd_err2); +#endif break; default: break; @@ -696,7 +700,8 @@ i_read_key(const onekey_t * rcmdlist, keeploc_t * locmem, mail_forward(&headers[locmem->crs_ln - locmem->top_ln], currdirect, ch /* == 'U' */ ); /* by CharlieL */ - mode = READ_REDRAW; + // mode = READ_REDRAW; + return FULLUPDATE; } break; @@ -918,9 +923,19 @@ i_read(int cmdmode, const char *direct, void (*dotitle) (), if (bidcache > 0 && !(currmode & (MODE_SELECT | MODE_DIGEST))){ bottom_line = getbtotal(currbid); num = bottom_line+getbottomtotal(currbid); + if(num == 0) + { + recbase = -1; + } } else + { num = get_num_records(currdirect, FHSZ); + if(num == 0) + { + recbase = -1; + } + } if (last_line != num) { last_line = num; |