New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variables related fixes #693
Conversation
This should fix the corner case where a variable is not assigned, but used anyway. This should solve partially the issue swaywm#681.
…les_corner_cases
@@ -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 $"); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation issues here.
I would rather add the $ for them than raise an error. |
…into variables_corner_cases
From what I understood from the i3 code this is the default behavior, it only raises an error. |
I think it would be better, yes. Log a warning though. |
@SirCmpwn is it ok now? Or do you need any modification to merge this? |
Thanks! |
This includes the check of the $ for the variable assigned.
So set something /home generates an error, since the correct syntax must be set $something /home.
This also should fix partially the issue #681 since now it handles the undefined behavior of p.we_wordv.