diff options
author | thuck <denisdoria@gmail.com> | 2016-06-02 23:23:04 +0200 |
---|---|---|
committer | thuck <denisdoria@gmail.com> | 2016-06-02 23:23:04 +0200 |
commit | 1ab3e1023e026cf9d6c51497739401fe580bf304 (patch) | |
tree | 0bc87f5ab27da924646d03e82e2e8f747da48a07 | |
parent | Merge pull request #691 from thuck/floating_size_conf (diff) | |
download | sway-1ab3e1023e026cf9d6c51497739401fe580bf304.tar.gz sway-1ab3e1023e026cf9d6c51497739401fe580bf304.tar.zst sway-1ab3e1023e026cf9d6c51497739401fe580bf304.zip |
Including error message when variable do not start with $
-rw-r--r-- | sway/commands.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 3befee13..3ccbcd2e 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -2152,6 +2152,10 @@ static struct cmd_results *cmd_set(int argc, char **argv) { | |||
2152 | return error; | 2152 | return error; |
2153 | } | 2153 | } |
2154 | 2154 | ||
2155 | if (argv[0][0] != '$') { | ||
2156 | return cmd_results_new(CMD_FAILURE, "set", "Malformed variable assignment, name has to start with $"); | ||
2157 | } | ||
2158 | |||
2155 | struct sway_variable *var = NULL; | 2159 | struct sway_variable *var = NULL; |
2156 | // Find old variable if it exists | 2160 | // Find old variable if it exists |
2157 | int i; | 2161 | int i; |