aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 3befee13..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);
@@ -2152,6 +2152,10 @@ static struct cmd_results *cmd_set(int argc, char **argv) {
return error;
}
+ if (argv[0][0] != '$') {
+ return cmd_results_new(CMD_FAILURE, "set", "Malformed variable assignment, name has to start with $");
+ }
+
struct sway_variable *var = NULL;
// Find old variable if it exists
int i;