[PATCH] wpa_cli: Add backspace key process for some terminal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, I add a routine to process '\b' character input.

Signed-off-by: Siwon Kang <kkangshawn@xxxxxxxxx>
---
 src/utils/edit_simple.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/utils/edit_simple.c b/src/utils/edit_simple.c
index 13173cb..9ac3f99 100644
--- a/src/utils/edit_simple.c
+++ b/src/utils/edit_simple.c
@@ -46,6 +46,12 @@ static void edit_read_char(int sock, void
*eloop_ctx, void *sock_ctx)
                fflush(stdout);
                return;
        }
+
+       if (c == '\b') {
+               if (cmdbuf_pos > 0) {
+                       cmdbuf[cmdbuf_pos--] = c;
+               }
+       }

        if (c >= 32 && c <= 255) {
                if (cmdbuf_pos < (int) sizeof(cmdbuf) - 1) {
-- 
1.9.1

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux