-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
interp: some binary tests should use space trim before atoi #928
Comments
Thanks for reporting. Want to send a PR? We should check other forms of arithmetic expressions too, like |
no, currently I don't have any relevant and correct PR. for the local issue I just made a call for |
For the record, this is a simple form of #754. When it comes to arithmetic expressions, we don't expand quoted strings into fields. If we did that, then the spaces would go away in your example. That said, this scenario is indeed easy to solve with TrimSpace, so it seems fine to me. cc @riacataquian |
It seems that the Bash trims spaces before integer comparison:
The sh/interp uses strict comparision rules and does not use any space trim functions before the binary tests that are defined in
interp/test.go
(binTest
func,atoi
).The text was updated successfully, but these errors were encountered: