diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-21 18:08:50 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-21 18:08:50 +0200 |
commit | ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f (patch) | |
tree | f293752ecdf4bbd104bee08362b4273bce151b0a | |
parent | bee3abbb6a6c2e70990bee4756cce948ece1e824 (diff) | |
download | pianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.tar.gz pianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.tar.bz2 pianobar-ed2a3a0cfe5e765c9bc54989fd9ed9eeeced3f0f.zip |
^H (ASCII BS) == ^? (ASCII DEL)
-rw-r--r-- | src/ui_readline.c | 4 |
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"); |