From 8e81add050809cd3a7ac75fa5a68d10cac57bb82 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 7 Jul 2013 11:40:23 +0200 Subject: [PATCH] readline(): Check common signals first. Make sure to check common signals first to prevent other interpretations. Signed-off-by: Joachim Nilsson --- src/editline.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/editline.c b/src/editline.c index 5220e65..f4b0bb3 100644 --- a/src/editline.c +++ b/src/editline.c @@ -901,21 +901,6 @@ static el_status_t emacs(int c) static el_status_t tty_special(int c) { - if (rl_meta_chars && ISMETA(c)) - return CSdispatch; - - if (c == rl_erase || c == DEL) - return bk_del_char(); - if (c == rl_kill) { - if (rl_point != 0) { - rl_point = 0; - reposition(); - } - Repeat = NO_ARG; - return kill_line(); - } - if (c == rl_eof && rl_point == 0 && rl_end == 0) - return CSeof; if (c == rl_intr) { el_intr_pending = SIGINT; return CSsignal; @@ -931,6 +916,23 @@ static el_status_t tty_special(int c) } #endif + if (rl_meta_chars && ISMETA(c)) + return CSdispatch; + + if (c == rl_erase || c == DEL) + return bk_del_char(); + if (c == rl_kill) { + if (rl_point != 0) { + rl_point = 0; + reposition(); + } + Repeat = NO_ARG; + return kill_line(); + } + + if (c == rl_eof && rl_point == 0 && rl_end == 0) + return CSeof; + return CSdispatch; }