From 8e3cef33d9d33dadaa75dc20a06de242471612f0 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 27 Oct 2011 23:27:33 +0100 Subject: [PATCH] Error out early if there is nothing to move Fixes: #532 --- src/cmdparse.y | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmdparse.y b/src/cmdparse.y index 0144524b..a1fb0473 100644 --- a/src/cmdparse.y +++ b/src/cmdparse.y @@ -762,6 +762,11 @@ move: { owindow *current; + /* Error out early to not create a non-existing workspace (in + * workspace_get()) if we are not actually able to move anything. */ + if (match_is_empty(¤t_match) && focused->type == CT_WORKSPACE) + break; + printf("should move window to workspace %s\n", $3); /* get the workspace */ Con *ws = workspace_get($3, NULL);