From 84b28dc5937e156db27df50854f93a7cfad82387 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 10 Oct 2018 10:49:34 -0400 Subject: cmd_bar: fix bar id issues Allows bar-subcommand to be a valid bar-ids Destroys runtime created bar if trying to use a config only subcommand Allow subcommands (except for id) to be ids --- sway/commands/bar/id.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sway/commands/bar/id.c') diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c index 65fa69fd..7690a852 100644 --- a/sway/commands/bar/id.c +++ b/sway/commands/bar/id.c @@ -13,6 +13,8 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) { const char *oldname = config->current_bar->id; if (strcmp(name, oldname) == 0) { return cmd_results_new(CMD_SUCCESS, NULL, NULL); // NOP + } else if (strcmp(name, "id") == 0) { + return cmd_results_new(CMD_INVALID, "id", "id cannot be 'id'"); } // check if id is used by a previously defined bar for (int i = 0; i < config->bars->length; ++i) { -- cgit v1.2.3-54-g00ecf