From: Art Cancro Date: Thu, 19 Apr 2012 16:09:10 +0000 (-0400) Subject: Replacement ctdl_getline() X-Git-Tag: v8.11~81 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8346162122d4195f28282d16b306a97efc9d7970 Replacement ctdl_getline() --- diff --git a/citadel/textclient/commands.c b/citadel/textclient/commands.c index a1ac03501..33c0d6927 100644 --- a/citadel/textclient/commands.c +++ b/citadel/textclient/commands.c @@ -492,7 +492,7 @@ int yesno_d(int d) * string Pointer to string buffer * lim Maximum length * noshow Echo asterisks instead of keystrokes? - * bs Allow backspacing out of the prompt? (NOT IMPLEMENTED YET) + * bs Allow backspacing out of the prompt? (returns -1 if this happens) * * returns: string length */ @@ -512,6 +512,11 @@ int ctdl_getline(char *string, int lim, int noshow, int bs) scr_putc(8); scr_putc(32); scr_putc(8); } + else if ((ch == 8) && (pos == 0) && (bs)) { /* backspace out of the prompt */ + async_ka_end(); + return(-1); + } + else if ((ch == 23) && (pos > 0)) { /* Ctrl-W deletes a word */ while ((pos > 0) && !isspace(string[pos])) { --pos;