From 8346162122d4195f28282d16b306a97efc9d7970 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 19 Apr 2012 12:09:10 -0400 Subject: [PATCH] Replacement ctdl_getline() --- citadel/textclient/commands.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.30.2