diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-11-25 13:22:30 -0600 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-11-25 13:22:30 -0600 |
commit | 0d88737a9f51a88645686c607dd76e8c9d183500 (patch) | |
tree | f61a37c16eacf892bd7ff78062e69bbc3068b888 /drivers/unix/os_unix.cpp | |
parent | 6e6fbdd59376dff76cd3b8f1db4b6dc0e2f91930 (diff) | |
parent | e9b57fce827c8fac5640a8a260dffd8682b660db (diff) | |
download | redot-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 'drivers/unix/os_unix.cpp')
-rw-r--r-- | drivers/unix/os_unix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index ffc270cd36..299ac6536f 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -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(); } |