summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-17 11:26:22 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2007-12-17 11:26:22 +0800
commitf665f13b5bdcb87f19a0681481f6044cbcc109b9 (patch)
tree59dc95cf053cc3e4ee3cbabc18f218f78d866404 /mbbsd/stuff.c
parente12b8fb5f87d5bede1af88074cd6c85be93b121c (diff)
downloadpttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar.gz
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar.bz2
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar.lz
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar.xz
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.tar.zst
pttbbs-f665f13b5bdcb87f19a0681481f6044cbcc109b9.zip
- general message update and optimization
- change search_num() to getdata(), allow unified control git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3698 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c46
1 files changed, 8 insertions, 38 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index e7cbaf34..fa4c424a 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -453,45 +453,15 @@ bell(void)
int
search_num(int ch, int max)
{
- int clen = 1;
- int x, y;
- char genbuf[10];
-
- outmsg(ANSI_COLOR(7) " 跳至第幾項:" ANSI_RESET);
- outc(ch);
- genbuf[0] = ch;
- getyx(&y, &x);
- x--;
- while ((ch = igetch()) != '\r') {
- if (ch == 'q' || ch == 'e')
- return -1;
- if (ch == '\n')
- break;
- if (ch == '\177' || ch == Ctrl('H')) {
- if (clen == 0) {
- bell();
- continue;
- }
- clen--;
- move(y, x + clen);
- outc(' ');
- move(y, x + clen);
- continue;
- }
- if (!isdigit(ch)) {
- bell();
- continue;
- }
- if (x + clen >= scr_cols || clen >= 6) {
- bell();
- continue;
- }
- genbuf[clen++] = ch;
- outc(ch);
- }
+ int clen = 1, y = b_lines - msg_occupied;
+ char genbuf[10];
+
+ genbuf[0] = ch; genbuf[1] = 0;
+ clen = getdata_buf(y, 0,
+ " 跳至第幾項: ", genbuf, sizeof(genbuf)-1, NUMECHO);
+
+ move(y, 0); clrtoeol();
genbuf[clen] = '\0';
- move(b_lines, 0);
- clrtoeol();
if (genbuf[0] == '\0')
return -1;
clen = atoi(genbuf);