From c484ab252e49865df0625167a85040bfc8d35bc0 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sun, 23 Jan 2022 14:46:56 +0100 Subject: [PATCH] config/rcxml: Prevent overwriting action argument --- src/config/rcxml.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config/rcxml.c b/src/config/rcxml.c index bc89b43c..104211f0 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -71,6 +71,9 @@ fill_keybind(char *nodename, char *content) } else if (!current_keybind_action) { wlr_log(WLR_ERROR, "expect element first. " "nodename: '%s' content: '%s'", nodename, content); + } else if (current_keybind_action->arg) { + wlr_log(WLR_ERROR, "Action argument already set: %s", + current_keybind_action->arg); } else if (!strcmp(nodename, "command.action")) { current_keybind_action->arg = strdup(content); } else if (!strcmp(nodename, "direction.action")) { @@ -125,6 +128,9 @@ fill_mousebind(char *nodename, char *content) } else if (!current_mousebind_action) { wlr_log(WLR_ERROR, "expect element first. " "nodename: '%s' content: '%s'", nodename, content); + } else if (current_mousebind_action->arg) { + wlr_log(WLR_ERROR, "Action argument already set: %s", + current_mousebind_action->arg); } else if (!strcmp(nodename, "command.action")) { current_mousebind_action->arg = strdup(content); } else if (!strcmp(nodename, "direction.action")) { -- 2.52.0