]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action.c: remove duplicate code
authorJohan Malm <jgm323@gmail.com>
Sun, 2 Jul 2023 20:20:04 +0000 (21:20 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 4 Jul 2023 05:01:47 +0000 (06:01 +0100)
src/action.c

index 11cb6fcf8459fad0c567f12071af6d2e4d0e38de..dc06bdf07627553050759a75d68aee53a541c1a3 100644 (file)
@@ -168,15 +168,12 @@ action_arg_from_xml_node(struct action *action, char *nodename, char *content)
 
        switch (action->type) {
        case ACTION_TYPE_EXECUTE:
-               if (!strcmp(argument, "command")) {
-                       action_arg_add_str(action, argument, content);
-                       goto cleanup;
-               } else if (!strcmp(argument, "execute")) {
-                       /*
-                        * <action name="Execute"><execute>foo</execute></action>
-                        * is deprecated, but we support it anyway for backward
-                        * compatibility with old openbox-menu generators
-                        */
+               /*
+                * <action name="Execute"> with an <execute> child is
+                * deprecated, but we support it anyway for backward
+                * compatibility with old openbox-menu generators
+                */
+               if (!strcmp(argument, "command") || !strcmp(argument, "execute")) {
                        action_arg_add_str(action, "command", content);
                        goto cleanup;
                }