From 54dc87fb83bdfbc8d09bfab039cc0b5a72fa8f04 Mon Sep 17 00:00:00 2001 From: Michael Hofmann Date: Mon, 30 Mar 2015 08:22:03 +0200 Subject: [PATCH 1/2] Testcase for #1607. - crash in startup_sequence_rename_workspace because of NULL old_name --- testcases/t/175-startup-notification.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testcases/t/175-startup-notification.t b/testcases/t/175-startup-notification.t index 4ca41799..b27bed53 100644 --- a/testcases/t/175-startup-notification.t +++ b/testcases/t/175-startup-notification.t @@ -155,6 +155,11 @@ cmd "rename workspace temp to $first_ws"; is_num_children($first_ws, 3, 'three containers on the first workspace'); +# empty 'from' workspaces should not crash the renaming of startup sequences +cmd "workspace $first_ws"; +cmd "rename workspace to temp"; +cmd "rename workspace to $first_ws"; + # Switch to the first workspace and move the focused window to the # second workspace. cmd "workspace $first_ws"; From f76e6c2bb1ea4a29429f009758b85185e2989464 Mon Sep 17 00:00:00 2001 From: Michael Hofmann Date: Mon, 30 Mar 2015 08:23:00 +0200 Subject: [PATCH 2/2] Get workspace name when renaming current workspace. - fixes #1607 --- src/commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands.c b/src/commands.c index ea0b9032..589c49ad 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1851,6 +1851,7 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) { !strcasecmp(child->name, old_name)); } else { workspace = con_get_workspace(focused); + old_name = workspace->name; } if (!workspace) {