summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-25 13:22:30 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-25 13:22:30 -0600
commit0d88737a9f51a88645686c607dd76e8c9d183500 (patch)
treef61a37c16eacf892bd7ff78062e69bbc3068b888 /platform
parent6e6fbdd59376dff76cd3b8f1db4b6dc0e2f91930 (diff)
parente9b57fce827c8fac5640a8a260dffd8682b660db (diff)
downloadredot-engine-0d88737a9f51a88645686c607dd76e8c9d183500.tar.gz
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`.
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 416016b112..984c9ae90e 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -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();