nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] input: accept only the four iTerm sequences that ac


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] input: accept only the four iTerm sequences that actually get handled
Date: Mon, 11 Jul 2016 16:42:40 +0200

This fixes https://savannah.gnu.org/bugs/?48455.
---
 src/winio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/winio.c b/src/winio.c
index 6cf7609..e9986fa 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -405,9 +405,6 @@ int parse_kbinput(WINDOW *win)
                                retval = controlleft;
                                break;
 #endif
-                           default:
-                               retval = ERR;
-                               break;
                        }
                        double_esc = FALSE;
                        escapes = 0;
@@ -471,7 +468,8 @@ int parse_kbinput(WINDOW *win)
                                retval = *kbinput;
                            }
                        }
-                   } else if (*kbinput=='[') {
+                   } else if (*kbinput=='[' &&
+                               *key_buffer >= 'A' && *key_buffer <= 'D') {
                        /* This is an iTerm2 sequence: ^[ ^[ [ X. */
                        double_esc = TRUE;
                    } else {
-- 
2.8.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]