mirror of
https://github.com/swaywm/sway.git
synced 2024-11-16 13:13:17 +00:00
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.
This commit is contained in:
parent
1ab3e1023e
commit
e4f80877be
|
@ -1632,7 +1632,7 @@ static struct cmd_results *cmd_output(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
char *src = join_args(argv + i, argc - i - 1);
|
char *src = join_args(argv + i, argc - i - 1);
|
||||||
char *mode = argv[argc - 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);
|
return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src);
|
||||||
}
|
}
|
||||||
free(src);
|
free(src);
|
||||||
|
|
Loading…
Reference in a new issue