* 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
*/
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;