aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiWon Kang <kkangshawn@gmail.com>2016-05-13 02:18:14 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-13 15:48:45 (GMT)
commit7a1887faece4377f13e39bec0346ae2ffd573b79 (patch)
treee12cf5db91485c2ba81324649a7d9a1759fd6c37
parent3dd0e9e4e46cc72b4abe6dd106184c153ec77efb (diff)
downloadhostap-7a1887faece4377f13e39bec0346ae2ffd573b79.zip
hostap-7a1887faece4377f13e39bec0346ae2ffd573b79.tar.gz
hostap-7a1887faece4377f13e39bec0346ae2ffd573b79.tar.bz2
wpa_cli: Add backspace key process for some terminal
In some terminal, verified with gtkterm and teraterm, backspace key is not properly processed. For instance, type 'abc', 3 times of backspace key press then '123' shows the result of 'abc123' instead of '123'. To fix this, add a routine to process '\b' character input when using edit_simple.c instead of edit.c (i.e., without CONFIG_WPA_CLI_EDIT=y). Signed-off-by: Siwon Kang <kkangshawn@gmail.com>
-rw-r--r--src/utils/edit_simple.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/edit_simple.c b/src/utils/edit_simple.c
index 13173cb..2ffd1a2 100644
--- a/src/utils/edit_simple.c
+++ b/src/utils/edit_simple.c
@@ -47,6 +47,12 @@ static void edit_read_char(int sock, void *eloop_ctx, void *sock_ctx)
return;
}
+ if (c == '\b') {
+ if (cmdbuf_pos > 0)
+ cmdbuf_pos--;
+ return;
+ }
+
if (c >= 32 && c <= 255) {
if (cmdbuf_pos < (int) sizeof(cmdbuf) - 1) {
cmdbuf[cmdbuf_pos++] = c;