Skip to content

Commit e96e5e7

Browse files
committed
Fix home path on Windows
1 parent 7dd6834 commit e96e5e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xtd.core.native.win32/src/xtd/native/win32/environment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ map<string, string>& environment::get_environment_variables(int_least32_t target
238238

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

0 commit comments

Comments
 (0)