diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2022-08-01 07:54:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-01 07:54:20 +0200 |
| commit | 44f1e540f62faf03e64411e1f52c3cb0a31d2758 (patch) | |
| tree | a041630fa75e65fa16811a72a33ff84a7264a98e /platform | |
| parent | 4d4575d3863663174c862f37f2d56596e8ad469b (diff) | |
| parent | 1418f97c70a5551bdbfeea853cbc479b32ea9e08 (diff) | |
| download | redot-engine-44f1e540f62faf03e64411e1f52c3cb0a31d2758.tar.gz | |
Merge pull request #63733 from akien-mga/file-get_as_text-skip-CR
File: Re-add support to skip CR (`\r`) in `File::get_as_text`
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/file_access_filesystem_jandroid.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/android/file_access_filesystem_jandroid.cpp b/platform/android/file_access_filesystem_jandroid.cpp index 733d92f741..6b21c18d59 100644 --- a/platform/android/file_access_filesystem_jandroid.cpp +++ b/platform/android/file_access_filesystem_jandroid.cpp @@ -29,9 +29,11 @@ /*************************************************************************/ #include "file_access_filesystem_jandroid.h" + #include "core/os/os.h" #include "core/templates/local_vector.h" #include "thread_jandroid.h" + #include <unistd.h> jobject FileAccessFilesystemJAndroid::file_access_handler = nullptr; @@ -198,7 +200,7 @@ String FileAccessFilesystemJAndroid::get_line() const { if (elem == '\n' || elem == '\0') { // Found the end of the line const_cast<FileAccessFilesystemJAndroid *>(this)->seek(start_position + line_buffer_position + 1); - if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position)) { + if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) { return String(); } return result; @@ -206,7 +208,7 @@ String FileAccessFilesystemJAndroid::get_line() const { } } - if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position)) { + if (result.parse_utf8((const char *)line_buffer.ptr(), line_buffer_position, true)) { return String(); } return result; |
