You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Convert line breaks to \n and strip line break from the end of string returned by OS::read_string_from_stdin/OS::get_stdin_string.
This commit is contained in:
@@ -191,7 +191,7 @@ String OS_Unix::get_stdin_string(int64_t p_buffer_size) {
|
||||
Vector<uint8_t> data;
|
||||
data.resize(p_buffer_size);
|
||||
if (fgets((char *)data.ptrw(), data.size(), stdin)) {
|
||||
return String::utf8((char *)data.ptr());
|
||||
return String::utf8((char *)data.ptr()).replace("\r\n", "\n").rstrip("\n");
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user