From 4ec4cd363e9db04a2d04f579fa19dc9d47335307 Mon Sep 17 00:00:00 2001 From: CraftyBoss Date: Fri, 10 Apr 2026 18:35:40 -0700 Subject: [PATCH] only check if iso path is not empty on android, split log messages by newlines to prevent truncation SDL_GetPathInfo doesnt seem able to get valid info from android, or theres some weird permission thing going on --- src/dusk/imgui/ImGuiPreLaunchWindow.cpp | 4 ++++ src/dusk/logging.cpp | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/dusk/imgui/ImGuiPreLaunchWindow.cpp b/src/dusk/imgui/ImGuiPreLaunchWindow.cpp index 3f0f1ed15f..0f8412187a 100644 --- a/src/dusk/imgui/ImGuiPreLaunchWindow.cpp +++ b/src/dusk/imgui/ImGuiPreLaunchWindow.cpp @@ -47,7 +47,11 @@ void fileDialogCallback(void* userdata, const char* const* filelist, [[maybe_unu ImGuiPreLaunchWindow::ImGuiPreLaunchWindow() = default; bool ImGuiPreLaunchWindow::isSelectedPathValid() const { +#if ANDROID + return !m_selectedIsoPath.empty(); // unsure why SDL_GetPathInfo doesnt work here +#else return !m_selectedIsoPath.empty() && SDL_GetPathInfo(m_selectedIsoPath.c_str(), nullptr); +#endif } void ImGuiPreLaunchWindow::draw() { diff --git a/src/dusk/logging.cpp b/src/dusk/logging.cpp index ee2913bc1a..b079d507c6 100644 --- a/src/dusk/logging.cpp +++ b/src/dusk/logging.cpp @@ -63,7 +63,21 @@ void aurora_log_callback(AuroraLogLevel level, const char* module, const char* m android_log_level = ANDROID_LOG_FATAL; break; } - __android_log_print(android_log_level, module, "%s\n", message); + + const char* start = message; + const char* end = message + len; + while (start < end) { + const char* newline = static_cast(memchr(start, '\n', end - start)); + if (!newline) { + __android_log_print(android_log_level, module, "%.*s", static_cast(end - start), start); + break; + } + if (newline > start) { + __android_log_print(android_log_level, module, "%.*s", static_cast(newline - start), start); + } + start = newline + 1; + } + if (level == LOG_FATAL) { abort(); }