]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config/rcxml: Prevent overwriting action argument
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Sun, 23 Jan 2022 13:46:56 +0000 (14:46 +0100)
committerARDiDo <90479315+ARDiDo@users.noreply.github.com>
Sun, 23 Jan 2022 15:44:51 +0000 (10:44 -0500)
src/config/rcxml.c

index bc89b43cba9dd8e66314496b44a3c393fcbb3b6e..104211f09778c9ac98cacce7d79c76db5680369b 100644 (file)
@@ -71,6 +71,9 @@ fill_keybind(char *nodename, char *content)
        } else if (!current_keybind_action) {
                wlr_log(WLR_ERROR, "expect <action name=\"\"> 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 <action name=\"\"> 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")) {