commit 1ab3e1023e026cf9d6c51497739401fe580bf304 parent 09670fc1a7485d75774c184fcbf8e907b9481aaa Author: thuck <denisdoria@gmail.com> Date: Thu, 2 Jun 2016 23:23:04 +0200 Including error message when variable do not start with $ Diffstat:
| M | sway/commands.c | | | 4 | ++++ |
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/sway/commands.c b/sway/commands.c @@ -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;