git-svn-id: svn://db.shs.com.ru/pip@778 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2019-04-16 13:48:13 +00:00
parent c6376002ed
commit 10b70f5acf
8 changed files with 88 additions and 30 deletions

View File

@@ -396,11 +396,17 @@ PIDir PIDir::home() {
delete[] rc;
return PIDir();
}
PIString s(rc);
s.replaceAll("\\", PIDir::separator);
PIString hp(rc);
memset(rc, 0, 1024);
if (ExpandEnvironmentStrings((LPCTSTR)"%HOMEDRIVE%", (LPTSTR)rc, 1024) == 0) {
delete[] rc;
return PIDir();
}
PIString hd(rc);
hp.replaceAll("\\", PIDir::separator);
delete[] rc;
s.prepend(separator);
return PIDir(s);
//s.prepend(separator);
return PIDir(hd + hp);
#else
# ifndef ESP_PLATFORM
rc = getenv("HOME");