aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-11 03:39:51 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-11 03:42:45 +0100
commit0ba3f08f526aac1668e53d5db696be36ba047b5d (patch)
treeba07516d440c50a9e71afe6ed87f318176c683f7 /sway
parentStrip quotes of each argv when handling command (diff)
downloadsway-0ba3f08f526aac1668e53d5db696be36ba047b5d.tar.gz
sway-0ba3f08f526aac1668e53d5db696be36ba047b5d.tar.zst
sway-0ba3f08f526aac1668e53d5db696be36ba047b5d.zip
Strip quotes from workspace name v2
This is a more general fix for #444 This reverts part of commit 222f0d44fcda494dca4d5278493a3082068743de.
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 0e81e6a7..06172ac4 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -717,14 +717,11 @@ static struct cmd_results *cmd_move(int argc, char **argv) {
717 return cmd_results_new(CMD_FAILURE, "move", "Can only move containers and views."); 717 return cmd_results_new(CMD_FAILURE, "move", "Can only move containers and views.");
718 } 718 }
719 719
720 char *ws_name = strdup(argv[3]); 720 const char *ws_name = argv[3];
721 strip_quotes(ws_name);
722 swayc_t *ws; 721 swayc_t *ws;
723 if (argc == 5 && strcasecmp(ws_name, "number") == 0) { 722 if (argc == 5 && strcasecmp(ws_name, "number") == 0) {
724 // move "container to workspace number x" 723 // move "container to workspace number x"
725 free(ws_name); 724 ws_name = argv[4];
726 ws_name = strdup(argv[4]);
727 strip_quotes(ws_name);
728 ws = workspace_by_number(ws_name); 725 ws = workspace_by_number(ws_name);
729 } else { 726 } else {
730 ws = workspace_by_name(ws_name); 727 ws = workspace_by_name(ws_name);
@@ -733,7 +730,6 @@ static struct cmd_results *cmd_move(int argc, char **argv) {
733 if (ws == NULL) { 730 if (ws == NULL) {
734 ws = workspace_create(ws_name); 731 ws = workspace_create(ws_name);
735 } 732 }
736 free(ws_name);
737 move_container_to(view, get_focused_container(ws)); 733 move_container_to(view, get_focused_container(ws));
738 } else if (strcasecmp(argv[1], "to") == 0 && strcasecmp(argv[2], "output") == 0) { 734 } else if (strcasecmp(argv[1], "to") == 0 && strcasecmp(argv[2], "output") == 0) {
739 // move container to output x 735 // move container to output x