From 0c4344e1bf52e48d29f0cb49cdc6ef473c5036e3 Mon Sep 17 00:00:00 2001 From: otavepto Date: Sat, 20 Apr 2024 17:24:26 +0200 Subject: [PATCH] fix that problem for Linux compilation --- dll/dll/common_includes.h | 1 + dll/settings_parser.cpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dll/dll/common_includes.h b/dll/dll/common_includes.h index 8792432a..20a02964 100644 --- a/dll/dll/common_includes.h +++ b/dll/dll/common_includes.h @@ -160,6 +160,7 @@ static inline void reset_LastError() #define PATH_MAX_STRING_SIZE 512 #define PATH_SEPARATOR "/" #define utf8_decode(a) a + #define utf8_encode(a) a #define reset_LastError() #endif diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index eaf092f0..1485887d 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -58,7 +58,7 @@ static void save_global_ini_value(const char *filename, const char *section, con new_ini.SetUnicode(); new_ini.SetSpaces(false); - std::wstring fullpath(utf8_decode(Local_Storage::get_user_appdata_path() + Local_Storage::settings_storage_folder + PATH_SEPARATOR + filename)); + auto fullpath = utf8_decode(Local_Storage::get_user_appdata_path() + Local_Storage::settings_storage_folder + PATH_SEPARATOR + filename); if (!common_helpers::create_dir(fullpath)) return; std::ifstream ini_file( fullpath, std::ios::binary | std::ios::in); @@ -1095,17 +1095,15 @@ static void parse_build_id(class Settings *settings_client, class Settings *sett // main::general::crash_printer_location static void parse_crash_printer_location() { - std::wstring crash_path{}; std::string line(common_helpers::string_strip(Settings::sanitize(ini.GetValue("main::general", "crash_printer_location", "")))); if (line.size()) { - crash_path = utf8_decode(common_helpers::to_absolute(line, get_full_program_path())); - } - - if (crash_path.size()) { - if (crash_printer::init(crash_path)) { - PRINT_DEBUG("Unhandled crashes will be saved to '%s'", utf8_encode(crash_path).c_str()); - } else { - PRINT_DEBUG("Failed to setup unhandled crash printer with path: '%s'", utf8_encode(crash_path).c_str()); + auto crash_path = utf8_decode(common_helpers::to_absolute(line, get_full_program_path())); + if (crash_path.size()) { + if (crash_printer::init(crash_path)) { + PRINT_DEBUG("Unhandled crashes will be saved to '%s'", utf8_encode(crash_path).c_str()); + } else { + PRINT_DEBUG("Failed to setup unhandled crash printer with path: '%s'", utf8_encode(crash_path).c_str()); + } } } }