summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 12:52:07 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 12:52:07 +0800
commit9ee78d22696759afe55bf1318b4fa86c04be695d (patch)
treeeae0f9324ee58d88ccf3e0fbebe8f2e7188eab8b /mbbsd
parent467fc70f836735290f55a0a90d7b462b44b7b757 (diff)
downloadpttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar.gz
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar.bz2
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar.lz
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar.xz
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.tar.zst
pttbbs-9ee78d22696759afe55bf1318b4fa86c04be695d.zip
pmore: goto made more reasonable
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2800 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/pmore.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/mbbsd/pmore.c b/mbbsd/pmore.c
index 76e968ca..ea100416 100644
--- a/mbbsd/pmore.c
+++ b/mbbsd/pmore.c
@@ -1420,7 +1420,7 @@ static const char * const pmore_help[] = {
"(,/</S-Tab)(./>/TAB) 左/右捲動",
"(0/g/Home) ($/G/End) 檔案開頭/結尾",
"(;/:) 跳至某行/某頁",
- "數字鍵 1-9 跳至輸入的行號",
+ "數字鍵 1-9 跳至輸入的頁數或行號",
"\01其他功\能鍵",
"(/" ANSI_COLOR(1;30) "/" ANSI_RESET
"s) 搜尋字串",
@@ -1992,21 +1992,22 @@ pmore(char *fpath, int promptend)
case '6': case '7': case '8': case '9':
case ';': case ':':
{
- char buf[10] = "";
+ char buf[16] = "";
int i = 0;
- int pageMode = (ch == ':');
+ int pageMode = (ch != ':');
if (ch >= '1' && ch <= '9')
buf[0] = ch, buf[1] = 0;
+ pmore_clrtoeol(b_lines-1, 0);
getdata_buf(b_lines-1, 0,
- (pageMode ? "跳至此頁: " :
- "跳至此行(若要指定頁數請在結尾加"
- ANSI_COLOR(1) "p" ANSI_RESET "): "),
- buf, 7, LCECHO);
+ (pageMode ?
+ "跳至此頁(若要改指定行數請在結尾加.): " :
+ "跳至此行: "),
+ buf, 8, DOECHO);
if(buf[0]) {
i = atoi(buf);
- if(buf[strlen(buf)-1] == 'p')
- pageMode = 1;
+ if(buf[strlen(buf)-1] == '.')
+ pageMode = 0;
if(i-- > 0)
mf_goto(i * (pageMode ? MFNAV_PAGE : 1));
}