aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-11 03:13:36 +0100
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-01-11 03:13:36 +0100
commit222f0d44fcda494dca4d5278493a3082068743de (patch)
treeb49ff12800562bd4fa12e4e4e08b8c75d89b43c9 /sway/commands.c
parent46992d60608c2f1251544d78333c67426962507e (diff)
Strip quotes from workspace name.
Fix #444 This is a temporary fix, the real fix is to store the commands as a formatted argv array, so they don't have to be reformatted all over the place.
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 0025fcb1..d5ffb519 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -717,11 +717,14 @@ static struct cmd_results *cmd_move(int argc, char **argv) {
return cmd_results_new(CMD_FAILURE, "move", "Can only move containers and views.");
}
- const char *ws_name = argv[3];
+ char *ws_name = strdup(argv[3]);
+ strip_quotes(ws_name);
swayc_t *ws;
if (argc == 5 && strcasecmp(ws_name, "number") == 0) {
// move "container to workspace number x"
- ws_name = argv[4];
+ free(ws_name);
+ ws_name = strdup(argv[4]);
+ strip_quotes(ws_name);
ws = workspace_by_number(ws_name);
} else {
ws = workspace_by_name(ws_name);
@@ -730,6 +733,7 @@ static struct cmd_results *cmd_move(int argc, char **argv) {
if (ws == NULL) {
ws = workspace_create(ws_name);
}
+ free(ws_name);
move_container_to(view, get_focused_container(ws));
} else if (strcasecmp(argv[1], "to") == 0 && strcasecmp(argv[2], "output") == 0) {
// move container to output x