-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
substr("x", 0, 0) returns "x" instead of "" #24318
Comments
I'm interested in contributing to terraform and thought this issue looked good (hope that's okay!). Looks like this is an issue in zclconf/go-cty. I've submitted a patch there (again, hope that's okay!) |
My upstream patch got merged. They're not ready to release a new version of go-cty and there's also the issue of this potentially being a breaking change (?) |
Hi @nick96! The go-cty release has been pulled into master now, so this fix will go out as part of 0.13. Thanks for your contribution! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It seems
substr
assumes the whole string tail must be returned when the last argument is zero:This behavior isn't described in the documentation; moreover, it seems this can lead to a number of issues when the length of a substring is computed rather than pre-defined.
The text was updated successfully, but these errors were encountered: