summaryrefslogtreecommitdiff
path: root/src/user/knob/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/user/knob/user.c')
-rw-r--r--src/user/knob/user.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/user/knob/user.c b/src/user/knob/user.c
index 4ef3321..c84977c 100644
--- a/src/user/knob/user.c
+++ b/src/user/knob/user.c
@@ -165,16 +165,20 @@ uint32_t ask_user_line_sz(char *sz, uint32_t max_length) {
goto replace;
if (key & 0x80)
goto replace;//TODO
+ if (key == '\b') {
+ if (i) {
+ --i;
+ _log_string("\b");
+ }
+ goto replace;
+ }
log_buf[0] = key;
_log_string(log_buf);
- if (key == '\b')
- i -= i ? 2 : 1;
- else if (key == '\n')
+ if (key == '\n')
break;
- else
- sz[i] = key;
+ sz[i] = key;
}
sz[i] = '\0';