mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03: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:
@@ -1751,7 +1751,7 @@ String OS_Windows::get_stdin_string(int64_t p_buffer_size) {
|
||||
data.resize(p_buffer_size);
|
||||
DWORD count = 0;
|
||||
if (ReadFile(GetStdHandle(STD_INPUT_HANDLE), data.ptrw(), data.size(), &count, nullptr)) {
|
||||
return String::utf8((const char *)data.ptr(), count);
|
||||
return String::utf8((const char *)data.ptr(), count).replace("\r\n", "\n").rstrip("\n");
|
||||
}
|
||||
|
||||
return String();
|
||||
|
||||
Reference in New Issue
Block a user