summaryrefslogtreecommitdiff
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorRyan Dwyer <[email protected]>2018-08-19 16:16:32 +1000
committerGitHub <[email protected]>2018-08-19 16:16:32 +1000
commit389d159c81502aa8b951895de11c3720bbd5ba7d (patch)
treec5d96041e3270b1d1d50f8a42d91652d615c9938 /sway/commands/move.c
parentd0a24465d75cc7197ee253e1de9fa961071cd034 (diff)
parent7f22fab3895ff090d5e26936f4e964e081090164 (diff)
Merge pull request #2453 from ianyfan/commands
More commands
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index acdc50b5..33d1ee4a 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE 500
+#include <ctype.h>
#include <stdbool.h>
#include <string.h>
#include <strings.h>
@@ -22,7 +23,7 @@
static const char *expected_syntax =
"Expected 'move <left|right|up|down> <[px] px>' or "
"'move [--no-auto-back-and-forth] <container|window> [to] workspace <name>' or "
- "'move [--no-auto-back-and-forth] <container|window|workspace> [to] output <name|direction>' or "
+ "'move <container|window|workspace> [to] output <name|direction>' or "
"'move <container|window> [to] mark <mark>'";
static struct sway_container *output_in_direction(const char *direction,
@@ -124,7 +125,11 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
return cmd_results_new(CMD_INVALID, "move",
expected_syntax);
}
- ws_name = strdup(argv[3]);
+ if (!isdigit(argv[3][0])) {
+ return cmd_results_new(CMD_INVALID, "move",
+ "Invalid workspace number '%s'", argv[3]);
+ }
+ ws_name = join_args(argv + 3, argc - 3);
ws = workspace_by_number(ws_name);
} else {
ws_name = join_args(argv + 2, argc - 2);