mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Merge pull request #99542 from bruvzg/stdin_str
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:
@@ -1739,7 +1739,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