diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-26 23:28:24 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-26 23:28:24 +0800 |
commit | 4b502e05397babe1c8050adb99c2f3e1ebcce641 (patch) | |
tree | 728b6c056cdbb67dc8579b5d789a967c1ad9858e /mbbsd/edit.c | |
parent | c144625766bb0db3b3f0bc5718fbe55d356e449f (diff) | |
parent | a08baf738de7959e912f5b12314da85eaea5a3c9 (diff) | |
download | pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.gz pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.bz2 pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.lz pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.xz pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.tar.zst pttbbs-4b502e05397babe1c8050adb99c2f3e1ebcce641.zip |
todo Ptt.read
simplify thread()
i_read()
git-svn-id: http://opensvn.csie.org/pttbbs/branches/Ptt.read@1862 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r-- | mbbsd/edit.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c index acc7bac0..eda5da08 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -258,7 +258,7 @@ ask(char *prompt) standout(); prints("%s", prompt); standend(); - ch = igetkey(); + ch = igetch(); move(0, 0); clrtoeol(); return (ch); @@ -966,7 +966,6 @@ write_file(char *fpath, int saveheader, int *islocal) switch (ans[0]) { case 'a': outs("文章\033[1m 沒有 \033[m存入"); - safe_sleep(1); aborted = -1; break; case 'r': @@ -1682,7 +1681,7 @@ vedit(char *fpath, int saveheader, int *islocal) move(curr_window_line, ch); if (!line_dirty && strcmp(line, currline->data)) strcpy(line, currline->data); - ch = igetkey(); + ch = igetch(); /* jochang debug */ if ((interval = (now - th))) { th = now; @@ -1836,28 +1835,27 @@ vedit(char *fpath, int saveheader, int *islocal) char *tmp, *apos = ans; int fg, bg; - strlcpy(color, "\033[", sizeof(color)); + strcpy(color, "\033["); if (isdigit(*apos)) { - snprintf(color, sizeof(color), - "%s%c", color, *(apos++)); + sprintf(color,"%s%c", color, *(apos++)); if (*apos) - snprintf(color, sizeof(color), "%s;", color); + strcat(color, ";"); } if (*apos) { if ((tmp = strchr(t, toupper(*(apos++))))) fg = tmp - t + 30; else fg = 37; - snprintf(color, sizeof(color), "%s%d", color, fg); + sprintf(color, "%s%d", color, fg); } if (*apos) { if ((tmp = strchr(t, toupper(*(apos++))))) bg = tmp - t + 40; else bg = 40; - snprintf(color, sizeof(color), "%s;%d", color, bg); + sprintf(color, "%s;%d", color, bg); } - snprintf(color, sizeof(color), "%sm", color); + strcat(color, "m"); insert_string(color); } else insert_string(reset_color); @@ -2023,7 +2021,7 @@ vedit(char *fpath, int saveheader, int *islocal) case '\n': #ifdef MAX_EDIT_LINE if( totaln == MAX_EDIT_LINE ){ - vmsg("MAX_EDIT_LINE exceed"); + outs("MAX_EDIT_LINE exceed"); break; } #endif |