From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sun, 23 Jan 2022 13:46:56 +0000 (+0100) Subject: config/rcxml: Prevent overwriting action argument X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=c484ab252e49865df0625167a85040bfc8d35bc0;p=proto%2Flabwc.git config/rcxml: Prevent overwriting action argument --- 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")) {