早上聽了野貓大大 才知道要改getdata部份 :p
So 就找來了森林物語的版本改了一下 :p
bbs.h中
#define NOECHO (0)
#define DOECHO (1) /* Flags to getdata input function */
#define LCECHO (2)
#define PASS (3)
io.c中
#define INPUT_ACTIVE 0
#define INPUT_IDLE 1
#define SCR_WIDTH 80
passwd_outs(text)
char *text;
{
register int column = 0;
register char ch;
while ((ch = *text++) && (++column < SCR_WIDTH))
{
outch('*');
}
}
getdata()中
{
! if (dumb_term || !echo || echo == PASS || echo == 9)
{
len--;
clen = 0;
while ((ch = igetch()) != '\r')
........
buf[clen++] = ch;
! if (echo && echo != 9)
! ochar(echo == PASS ? '*' : ch);
}
buf[clen] = '\0';
outc('\n');
oflush();
}
........
while (move(y, x + currchar), (ch = igetkey()) != '\r')
{
case KEY_UP: {
......
for (i = 0; i <= clen; i++)
outc(' ');
move(y, x);
if (echo == PASS)
passwd_outs(buf);
else
edit_outs(buf);
.....
}
if (ch == Ctrl('D')) {
move(y, x);
if (echo == PASS)
passwd_outs(buf);
else
edit_outs(buf);
dirty = 1;
main.c中
! getdata(22, 0, "請輸入密碼: ", passbuf, PASSLEN, PASS, 0);
passbuf[8] = '\0';
其他地方只要有出現
getdata(22, 0, "請輸入密碼: ", passbuf, PASSLEN, PASS, 0);等等就改吧...