aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2016-06-03 00:05:10 +0200
committerFurkan Sahin <furkan-dev@proton.me>2016-06-03 00:05:10 +0200
commit90eceb978c578614fa46005d3ff9b551f29981d2 (patch)
tree7e8e9433470bc1c9e0cdedaf10fec932759b2aee
parent965cba2c29cda5bc1ec524369f3b5cdde3fbd745 (diff)
Fix output command when varible not set
This should fix the corner case where a variable is not assigned, but used anyway. This should solve partially the issue #681.
-rw-r--r--sway/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 3ccbcd2e..febff2dd 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1632,7 +1632,7 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
}
char *src = join_args(argv + i, argc - i - 1);
char *mode = argv[argc - 1];
- if (wordexp(src, &p, 0) != 0) {
+ if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) {
return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src);
}
free(src);