mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
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>
This commit is contained in:
parent
3dd0e9e4e4
commit
7a1887faec
@ -47,6 +47,12 @@ static void edit_read_char(int sock, void *eloop_ctx, void *sock_ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c == '\b') {
|
||||||
|
if (cmdbuf_pos > 0)
|
||||||
|
cmdbuf_pos--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (c >= 32 && c <= 255) {
|
if (c >= 32 && c <= 255) {
|
||||||
if (cmdbuf_pos < (int) sizeof(cmdbuf) - 1) {
|
if (cmdbuf_pos < (int) sizeof(cmdbuf) - 1) {
|
||||||
cmdbuf[cmdbuf_pos++] = c;
|
cmdbuf[cmdbuf_pos++] = c;
|
||||||
|
Loading…
Reference in New Issue
Block a user