diff options
author | thuck <denisdoria@gmail.com> | 2016-06-03 00:05:10 +0200 |
---|---|---|
committer | thuck <denisdoria@gmail.com> | 2016-06-03 00:05:10 +0200 |
commit | e4f80877bea48eb29b4ddfbce923bf78a6694ffb (patch) | |
tree | 7e8e9433470bc1c9e0cdedaf10fec932759b2aee | |
parent | Including error message when variable do not start with $ (diff) | |
download | sway-e4f80877bea48eb29b4ddfbce923bf78a6694ffb.tar.gz sway-e4f80877bea48eb29b4ddfbce923bf78a6694ffb.tar.zst sway-e4f80877bea48eb29b4ddfbce923bf78a6694ffb.zip |
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.c | 2 |
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) { | |||
1632 | } | 1632 | } |
1633 | char *src = join_args(argv + i, argc - i - 1); | 1633 | char *src = join_args(argv + i, argc - i - 1); |
1634 | char *mode = argv[argc - 1]; | 1634 | char *mode = argv[argc - 1]; |
1635 | if (wordexp(src, &p, 0) != 0) { | 1635 | if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) { |
1636 | return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src); | 1636 | return cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src); |
1637 | } | 1637 | } |
1638 | free(src); | 1638 | free(src); |