From eb45cb7b6072ffdc6391a8c8fc09cdeffdc9f429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 8 Sep 2020 19:08:26 +0200 Subject: [PATCH 1/2] wayland: set BIND_ACTION_KEY_COUNT correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an issue where ‘pipe-selected’ were not recognized as a valid key action. Closes #125 --- wayland.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wayland.h b/wayland.h index 7757c970..e12d816a 100644 --- a/wayland.h +++ b/wayland.h @@ -43,8 +43,6 @@ enum bind_action_normal { BIND_ACTION_PIPE_VIEW, BIND_ACTION_PIPE_SELECTED, - BIND_ACTION_KEY_COUNT = BIND_ACTION_PIPE_SELECTED, - /* Mouse specific actions - i.e. they require a mouse coordinate */ BIND_ACTION_SELECT_BEGIN, BIND_ACTION_SELECT_BEGIN_BLOCK, @@ -53,7 +51,8 @@ enum bind_action_normal { BIND_ACTION_SELECT_WORD_WS, BIND_ACTION_SELECT_ROW, - BIND_ACTION_COUNT, + BIND_ACTION_KEY_COUNT = BIND_ACTION_PIPE_SELECTED + 1, + BIND_ACTION_COUNT = BIND_ACTION_SELECT_ROW + 1, }; struct key_binding_normal { From 04e8588e05e7b90f9a83a5a317ded0f3621777a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 8 Sep 2020 19:09:36 +0200 Subject: [PATCH 2/2] config: key binding: free pipe cmd/argv when action is invalid --- config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.c b/config.c index f15be1c2..7b71df95 100644 --- a/config.c +++ b/config.c @@ -1107,6 +1107,8 @@ parse_section_key_bindings( LOG_AND_NOTIFY_ERR("%s:%u: [key-bindings]: %s: invalid action", path, lineno, key); + free(pipe_cmd); + free(pipe_argv); return false; }