diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c index 9c5309f9..fbdb5fb8 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -1557,14 +1557,15 @@ static struct cmd_results *cmd_output(int argc, char **argv) { | |||
1557 | if (++i >= argc) { | 1557 | if (++i >= argc) { |
1558 | return cmd_results_new(CMD_INVALID, "output", "Missing background file."); | 1558 | return cmd_results_new(CMD_INVALID, "output", "Missing background file."); |
1559 | } | 1559 | } |
1560 | char *src = argv[i]; | 1560 | if (i + 1 >= argc) { |
1561 | if (++i >= argc) { | ||
1562 | return cmd_results_new(CMD_INVALID, "output", "Missing background scaling mode."); | 1561 | return cmd_results_new(CMD_INVALID, "output", "Missing background scaling mode."); |
1563 | } | 1562 | } |
1564 | char *mode = argv[i]; | 1563 | char *src = join_args(argv + i, argc - i - 1); |
1564 | char *mode = argv[argc - 1]; | ||
1565 | if (wordexp(src, &p, 0) != 0) { | 1565 | if (wordexp(src, &p, 0) != 0) { |
1566 | return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src); | 1566 | return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src); |
1567 | } | 1567 | } |
1568 | free(src); | ||
1568 | src = p.we_wordv[0]; | 1569 | src = p.we_wordv[0]; |
1569 | if (config->reading && *src != '/') { | 1570 | if (config->reading && *src != '/') { |
1570 | char *conf = strdup(config->current_config); | 1571 | char *conf = strdup(config->current_config); |