From a2bc89db642b7f4f3b2a48452c2a56bcfef52299 Mon Sep 17 00:00:00 2001 From: Toby Goodwin Date: Sat, 4 Apr 2015 23:29:14 +0100 Subject: [PATCH] Allow Ctrl-D to return EOF This commit reverts parts of 111fc5e, which originally was intended to add support for custom key bindings at pos 0, or more specifically, to be able to change the behavior of Ctrl-D. However this completely broke compatibility with the original EOF behavior. Signed-off-by: Toby Goodwin Signed-off-by: Joachim Nilsson --- src/editline.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/editline.c b/src/editline.c index 7300606..df42b05 100644 --- a/src/editline.c +++ b/src/editline.c @@ -124,7 +124,6 @@ char **(*rl_attempted_completion_function)(const char *token, int start, int end /* Declarations. */ static char *editinput(void); -static int is_ctl_map_key(int key); #ifdef CONFIG_USE_TERMCAP extern char *tgetstr(const char *, char **); extern int tgetent(char *, const char *); @@ -954,9 +953,6 @@ static el_status_t tty_special(int c) return kill_line(); } - if (is_ctl_map_key(c)) - return CSdispatch; - if (c == rl_eof && rl_point == 0 && rl_end == 0) return CSeof; @@ -1694,13 +1690,6 @@ static size_t find_key_in_map(int key, el_keymap_t map[], size_t mapsz) return mapsz; } -static int is_ctl_map_key(int key) -{ - size_t mapsz = ARRAY_ELEMENTS(Map); - - return mapsz != find_key_in_map(key, Map, mapsz); -} - static el_status_t el_bind_key_in_map(int key, el_keymap_func_t function, el_keymap_t map[], size_t mapsz) { size_t creat, pos = find_key_in_map(key, map, mapsz);