diff options
-rw-r--r-- | mbbsd/mail.c | 31 | ||||
-rw-r--r-- | mbbsd/pmore.c | 13 | ||||
-rw-r--r-- | mbbsd/screen.c | 9 |
3 files changed, 41 insertions, 12 deletions
diff --git a/mbbsd/mail.c b/mbbsd/mail.c index 0196aa88..2b9db957 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -1283,16 +1283,26 @@ mail_cross_post(int ent, fileheader_t * fhdr, const char *direct) char genbuf[200]; char genbuf2[4]; + // XXX (will crash sometimes because currborad is not defined yet) + // 麻煩 in2 來修復這裡。 + if (!currboard || currboard[0] == 0) + currboard = DEFAULT_BOARD; + if (!CheckPostPerm()) { vmsg("對不起,您目前無法轉錄文章!"); return FULLUPDATE; } + move(2, 0); clrtoeol(); move(1, 0); CompleteBoard("轉錄本文章於看板:", xboard); + if (*xboard == '\0' || !haspostperm(xboard)) + { + vmsg("無法轉錄"); return FULLUPDATE; + } /* 借用變數 */ ent = StringHash(fhdr->title); @@ -1477,7 +1487,7 @@ mail_save(int ent, fileheader_t * fhdr, const char *direct) static int mail_waterball(int ent, fileheader_t * fhdr, const char *direct) { - static char address[60], cmode = 1; + static char address[60] = "", cmode = 1; char fname[500], genbuf[200]; FILE *fp; @@ -1485,14 +1495,17 @@ mail_waterball(int ent, fileheader_t * fhdr, const char *direct) vmsg("必須是 熱線記錄 才能使用水球整理的唷!"); return 1; } + if (!address[0]) strlcpy(address, cuser.email, sizeof(address)); - move(b_lines - 8, 0); - outs("水球整理程式:\n" + + move(b_lines - 8, 0); clrtobot(); + outs(ANSI_COLOR(1;33;45) "★水球整理程式 " ANSI_RESET "\n" "系統將會按照和不同人丟的水球各自獨立\n" "於整點的時候 (尖峰時段除外) 將資料整理好寄送給您\n\n\n"); + if (address[0]) { - snprintf(genbuf, sizeof(genbuf), "寄給 [%s] 嗎(Y/N/Q)?[Y] ", address); + snprintf(genbuf, sizeof(genbuf), "寄往 [%s] 嗎[Y/n/q]? ", address); getdata(b_lines - 5, 0, genbuf, fname, 3, LCECHO); if (fname[0] == 'q') { outmsg("取消處理"); @@ -1502,19 +1515,24 @@ mail_waterball(int ent, fileheader_t * fhdr, const char *direct) address[0] = '\0'; } if (!address[0]) { + move(b_lines-4, 0); + prints( "請注意目前只支援寄往標準 e-mail 地址。\n" + "若想寄回此信箱請用輸入 %s.bbs@" MYHOSTNAME "\n", cuser.userid); + getdata(b_lines - 5, 0, "請輸入郵件地址:", fname, 60, DOECHO); if (fname[0] && strchr(fname, '.')) { strlcpy(address, fname, sizeof(address)); } else { - vmsg("取消處理"); + vmsg("地址格式不正確,取消處理"); return 1; } } trim(address); if (invalidaddr(address)) return -2; + move(b_lines-4, 0); clrtobot(); + if( strstr(address, ".bbs") && REJECT_OUTTAMAIL ){ - move(b_lines - 4, 0); outs("\n您必須要打開接受站外信, 水球整理系統才能寄入結果\n" "請麻煩到【郵件選單】按大寫 O改成接受站外信 (在右上角)\n" "再重新執行本功\能 :)\n"); @@ -1523,7 +1541,6 @@ mail_waterball(int ent, fileheader_t * fhdr, const char *direct) } //snprintf(fname, sizeof(fname), "%d\n", cmode); - move(b_lines - 4, 0); outs("系統提供兩種模式: \n" "模式 0: 精簡模式, 將不含顏色控制碼, 方便以純文字編輯器整理收藏\n" "模式 1: 華麗模式, 包含顏色控制碼等, 方便在 bbs上直接編輯收藏\n"); diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c index 1d619cf8..06226914 100644 --- a/mbbsd/pmore.c +++ b/mbbsd/pmore.c @@ -72,6 +72,8 @@ // ----------------------------------------------------------- <LOCALIZATION> // Messages for localization are listed here. +#define PMORE_MSG_PREF_TITLE \ + " pmore 2007 設定選項 " #define PMORE_MSG_WARN_FAKEUSERINFO \ " ▲此頁內容會依閱\讀者不同,原文未必有您的資料 " #define PMORE_MSG_SEARCH_KEYWORD \ @@ -2302,13 +2304,14 @@ pmore(char *fpath, int promptend) #define PMORE_NOTIFY_NEWPREF #ifdef PMORE_NOTIFY_NEWPREF //let's be backward compatible! - case '\\': - case '|': case 'l': case 'w': case 'W': + + case '|': + case '\\': { - static int notifyChanged = 0; + static char notifyChanged = 0; if (!notifyChanged) { notifyChanged = 1; @@ -2473,7 +2476,7 @@ pmore_Preference() { move(b_lines - 10, 0); clrtobot(); - const char *caption = " pmore 設定選項 "; + const char *caption = PMORE_MSG_PREF_TITLE; // draw separator outs(ANSI_COLOR(1;30)); @@ -2492,7 +2495,7 @@ pmore_Preference() pmore_prefEntry(bpref.wrapmode, "w", 1, "斷行方式:", -1, - "自動斷行\t截行(不自動斷行)"); + "直接截行\t自動斷行"); pmore_prefEntry(bpref.wrapindicator, "m", 1, "斷行符號:", -1, diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 4d9159ba..4115c45c 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -575,6 +575,9 @@ grayout_lines(int y, int end, int level) if (slp->len < 1) continue; + if (slp->len >= ANSILINELEN) + slp->len = ANSILINELEN -1; + // tweak slp slp->data[slp->len] = 0; slp->mode &= ~STANDOUT; @@ -596,6 +599,12 @@ grayout_lines(int y, int end, int level) switch(level) { case 0: // dark text + // basically, in current system slp->data will + // not exceed t_columns. buffer overflow is impossible. + // but to make it more robust, let's quick check here. + // of course, t_columns should always be far smaller. + if (strlen((char*)slp->data) > t_columns) + slp->data[t_columns] = 0; strcpy((char*)slp->data, ANSI_COLOR(1;30;40)); strcat((char*)slp->data, buf); strcat((char*)slp->data, ANSI_RESET ANSI_CLRTOEND); |