mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-07 21:50:08 +01:00
Windows: look for config files in $LOCALAPPDATA
This commit is contained in:
@@ -11,7 +11,12 @@ struct passwd* ffGetPasswd()
|
||||
DWORD len = sizeof(res.pw_name);
|
||||
GetUserNameA(res.pw_name, &len);
|
||||
|
||||
SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, res.pw_dir);
|
||||
PWSTR pPath;
|
||||
if(SUCCEEDED(SHGetKnownFolderPath(&FOLDERID_Profile, KF_FLAG_DEFAULT, NULL, &pPath)))
|
||||
WideCharToMultiByte(CP_UTF8, 0, pPath, -1, res.pw_dir, sizeof(res.pw_dir), NULL, NULL); //res has been NULL inited
|
||||
CoTaskMemFree(pPath);
|
||||
for (char *current_pos = strchr(res.pw_dir, '\\'); current_pos; current_pos = strchr(current_pos + 1, '\\'))
|
||||
*current_pos = '/';
|
||||
|
||||
return &res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user