projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
66a9df1
)
Replacement ctdl_getline()
author
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 19 Apr 2012 16:09:10 +0000
(12:09 -0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Thu, 19 Apr 2012 16:09:10 +0000
(12:09 -0400)
citadel/textclient/commands.c
patch
|
blob
|
history
diff --git
a/citadel/textclient/commands.c
b/citadel/textclient/commands.c
index a1ac0350187bb9673bce53543c0ba3660df40685..33c0d6927ea7ca3b00e8eceed10f6c08c7fa1b6c 100644
(file)
--- 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?
* 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
*/
*
* 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);
}
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;
else if ((ch == 23) && (pos > 0)) { /* Ctrl-W deletes a word */
while ((pos > 0) && !isspace(string[pos])) {
--pos;