From 1d2a15e040b272155d3e40b597292a56de540e7d Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 14 May 2020 09:12:41 +0100 Subject: ash: proper accounting for backspaces in the read builtin When the '-n' option of the 'read' builtin is used we need to account for backspaces: increase 'nchars' when backspace removes a character from the buffer. --- shell/shell_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/shell_common.c b/shell/shell_common.c index 9092a8e2b..e50a79b78 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -248,6 +248,7 @@ shell_builtin_read(struct builtin_read_params *params) else if (key == '\b') { if (bufpos > 0) { --bufpos; + ++nchars; if (!(read_flags & BUILTIN_READ_SILENT)) { printf("\b \b"); } -- cgit v1.2.3-55-g6feb