-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
A string from the standard input is incorrectly compared with another #80136
Comments
Have you tried if it matches "test\n"? |
"test\n" is also not true |
Can confirm that it does include a linebreak, and the actual line is "test\r\n", at least on Windows, you need to strip the newlines Would need to be documented or discussed, exactly how it works |
I read the description of the pull request for this method and figured out my problem. You need to use OS.read_string_from_stdin().strip_edges() and then string comparison will be correct. I think it will be enough to leave a mention in the documentation for the strip_edges method for OS.read_string_from_stdin() |
As I was saying, you didn't need to figure it out yourself 🙃 |
After Godot 4.4 dev 5 stdin handling will work via OS.read_string_from_stdin(1024).strip_edges() |
In the end we assessed that it's a bug, and #99542 will fix it. |
Godot version
v4.1.1.rc.custom_build.e709ad4d6
System information
Arch Linux x86_64
Issue description
The following condition will never be true, even if the user enters the value of another string correctly.
Steps to reproduce
Minimal reproduction project
stdin-mrp.zip
The text was updated successfully, but these errors were encountered: