Skip to content

Commit

Permalink
Strip quotes from workspace name v2
Browse files Browse the repository at this point in the history
This is a more general fix for #444

This reverts part of commit 222f0d4.
  • Loading branch information
mikkeloscar committed Jan 11, 2016
1 parent fc8e570 commit 0ba3f08
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sway/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,14 +717,11 @@ static struct cmd_results *cmd_move(int argc, char **argv) {
return cmd_results_new(CMD_FAILURE, "move", "Can only move containers and views.");
}

char *ws_name = strdup(argv[3]);
strip_quotes(ws_name);
const char *ws_name = argv[3];
swayc_t *ws;
if (argc == 5 && strcasecmp(ws_name, "number") == 0) {
// move "container to workspace number x"
free(ws_name);
ws_name = strdup(argv[4]);
strip_quotes(ws_name);
ws_name = argv[4];
ws = workspace_by_number(ws_name);
} else {
ws = workspace_by_name(ws_name);
Expand All @@ -733,7 +730,6 @@ 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
Expand Down

0 comments on commit 0ba3f08

Please sign in to comment.