Skip to content

Commit

Permalink
Fix home path on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Jun 23, 2024
1 parent 7dd6834 commit e96e5e7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ map<string, string>& environment::get_environment_variables(int_least32_t target

string environment::get_know_folder_path(int_least32_t id) {
if (id == CSIDL_HOME)
return get_environment_variable("HOMEPATH", ENVIRONMENT_VARIABLE_TARGET_PROCESS);
return get_environment_variable("HOMEDRIVE", ENVIRONMENT_VARIABLE_TARGET_PROCESS) + get_environment_variable("HOMEPATH", ENVIRONMENT_VARIABLE_TARGET_PROCESS);
auto path = wstring(65535 , '\0');
return SHGetFolderPath(nullptr, id, nullptr, SHGFP_TYPE_CURRENT, path.data()) == S_OK ? win32::strings::to_string(path) : "";
}
Expand Down

0 comments on commit e96e5e7

Please sign in to comment.