aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/shell_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index be69ff249..af05625a4 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -197,6 +197,7 @@ shell_builtin_read(struct builtin_read_params *params)
197 if ((bufpos & 0xff) == 0) 197 if ((bufpos & 0xff) == 0)
198 buffer = xrealloc(buffer, bufpos + 0x101); 198 buffer = xrealloc(buffer, bufpos + 0x101);
199 199
200 IF_PLATFORM_MINGW32(loop:)
200 timeout = -1; 201 timeout = -1;
201 if (params->opt_t) { 202 if (params->opt_t) {
202 timeout = end_ms - (unsigned)monotonic_ms(); 203 timeout = end_ms - (unsigned)monotonic_ms();
@@ -239,6 +240,15 @@ shell_builtin_read(struct builtin_read_params *params)
239 retval = (const char *)(uintptr_t)1; 240 retval = (const char *)(uintptr_t)1;
240 goto ret; 241 goto ret;
241 } 242 }
243 else if (key == '\b') {
244 if (bufpos > 0) {
245 --bufpos;
246 if (!(read_flags & BUILTIN_READ_SILENT)) {
247 printf("\b \b");
248 }
249 }
250 goto loop;
251 }
242 buffer[bufpos] = key == '\r' ? '\n' : key; 252 buffer[bufpos] = key == '\r' ? '\n' : key;
243 if (!(read_flags & BUILTIN_READ_SILENT)) { 253 if (!(read_flags & BUILTIN_READ_SILENT)) {
244 /* echo input if not in silent mode */ 254 /* echo input if not in silent mode */