summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-08-21 18:08:50 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-08-21 18:08:50 +0200
commited2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f (patch)
treef293752ecdf4bbd104bee08362b4273bce151b0a
parentbee3abbb6a6c2e70990bee4756cce948ece1e824 (diff)
downloadpianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.tar.gz
pianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.tar.bz2
pianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.zip
^H (ASCII BS) == ^? (ASCII DEL)
-rw-r--r--src/ui_readline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui_readline.c b/src/ui_readline.c
index f804eab..6b92ca6 100644
--- a/src/ui_readline.c
+++ b/src/ui_readline.c
@@ -92,7 +92,8 @@ size_t BarReadline (char *buf, size_t bufSize, const char *mask,
break;
/* backspace */
- case 127:
+ case 8: /* ASCII BS */
+ case 127: /* ASCII DEL */
if (bufPos > 0) {
if (BarReadlineIsAscii (buf[bufPos-1])) {
BarReadlineMoveLeft (buf, &bufPos, &bufLen);
@@ -115,6 +116,7 @@ size_t BarReadline (char *buf, size_t bufSize, const char *mask,
fflush (stdout);
}
} else if (bufPos == 0 && buf[bufPos] != '\0') {
+ /* delete char at position 0 but don't move cursor any further */
buf[bufPos] = '\0';
if (!noEcho) {
printf ("\033[K");