From db7bef7988f90db112be3a18fcc9d26f0a30e232 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 19 Apr 2012 11:43:47 -0400 Subject: [PATCH] The 'negative number for asterisk echo' functionality is no longer in ctdl_getline(), it has been moved to newprompt() and strprompt() --- citadel/textclient/commands.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/citadel/textclient/commands.c b/citadel/textclient/commands.c index e6cbffc77..3175f12b3 100644 --- a/citadel/textclient/commands.c +++ b/citadel/textclient/commands.c @@ -491,17 +491,13 @@ int yesno_d(int d) * Function to read a line of text from the terminal. * * string Pointer to string buffer - * lim Maximum length - if negative, echo asterisks instead of characters + * lim Maximum length + * noshow If nonzero, echo asterisks instead of keystrokes */ -void ctdl_getline(char *string, int lim) +void ctdl_getline(char *string, int lim, int noshow) { int a, b; - char noshow = 0; - if (lim < 0) { - lim = (0 - lim); - noshow = 1; - } strcpy(string, ""); gl_string = string; async_ka_start(); @@ -574,7 +570,7 @@ void strprompt(char *prompt, char *str, int len) color(DIM_WHITE); scr_printf(": "); color(BRIGHT_CYAN); - ctdl_getline(buf, len); + ctdl_getline(buf, abs(len), (len<0)); if (buf[0] != 0) { strcpy(str, buf); } @@ -641,7 +637,7 @@ void newprompt(char *prompt, char *str, int len) color(BRIGHT_MAGENTA); scr_printf("%s", prompt); color(DIM_MAGENTA); - ctdl_getline(str, len); + ctdl_getline(str, abs(len), (len<0)); color(DIM_WHITE); } @@ -1057,7 +1053,7 @@ int getcmd(CtdlIPC *ipc, char *argbuf) /* We've found our command. */ if (requires_string(cptr, cmdpos)) { argbuf[0] = 0; - ctdl_getline(argbuf, 64); + ctdl_getline(argbuf, 64, 0); } else { scr_printf("\n"); } -- 2.30.2