mirror of
https://github.com/monero-project/monero.git
synced 2025-08-11 07:10:11 -04:00
Merge pull request #9908
9891fe8
epee: fix string_tools on Windows (0xFFFC0000)
This commit is contained in:
commit
c572e1ad00
1 changed files with 7 additions and 3 deletions
|
@ -153,11 +153,15 @@ namespace string_tools
|
||||||
|
|
||||||
void set_module_name_and_folder(const std::string& path_to_process_)
|
void set_module_name_and_folder(const std::string& path_to_process_)
|
||||||
{
|
{
|
||||||
boost::filesystem::path path_to_process = path_to_process_;
|
boost::filesystem::path path_to_process;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
path_to_process = get_current_module_path();
|
// Convert to wide string to avoid codecvt errors with Unicode paths
|
||||||
#endif
|
std::wstring wpath = epee::string_tools::utf8_to_utf16(get_current_module_path());
|
||||||
|
path_to_process = boost::filesystem::path(wpath);
|
||||||
|
#else
|
||||||
|
path_to_process = boost::filesystem::path(path_to_process_);
|
||||||
|
#endif
|
||||||
|
|
||||||
get_current_module_name() = path_to_process.filename().string();
|
get_current_module_name() = path_to_process.filename().string();
|
||||||
get_current_module_folder() = path_to_process.parent_path().string();
|
get_current_module_folder() = path_to_process.parent_path().string();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue