mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-17 21:04:03 +01:00
Merge branch '0.4.x' into 0.5.0.x
This commit is contained in:
19
src/util.cpp
19
src/util.cpp
@@ -737,26 +737,35 @@ string MyGetSpecialFolderPath(int nFolder, bool fCreate)
|
||||
{
|
||||
PSHGETSPECIALFOLDERPATHA pSHGetSpecialFolderPath =
|
||||
(PSHGETSPECIALFOLDERPATHA)GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
|
||||
bool fSuccess = false;
|
||||
if (pSHGetSpecialFolderPath)
|
||||
fSuccess =
|
||||
(*pSHGetSpecialFolderPath)(NULL, pszPath, nFolder, fCreate);
|
||||
FreeModule(hShell32);
|
||||
if (fSuccess)
|
||||
return pszPath;
|
||||
}
|
||||
|
||||
// Backup option
|
||||
if (pszPath[0] == '\0')
|
||||
std::string strPath;
|
||||
{
|
||||
const char *pszEnv;
|
||||
if (nFolder == CSIDL_STARTUP)
|
||||
{
|
||||
strcpy(pszPath, getenv("USERPROFILE"));
|
||||
strcat(pszPath, "\\Start Menu\\Programs\\Startup");
|
||||
pszEnv = getenv("USERPROFILE");
|
||||
if (pszEnv)
|
||||
strPath = pszEnv;
|
||||
strPath += "\\Start Menu\\Programs\\Startup";
|
||||
}
|
||||
else if (nFolder == CSIDL_APPDATA)
|
||||
{
|
||||
strcpy(pszPath, getenv("APPDATA"));
|
||||
pszEnv = getenv("APPDATA");
|
||||
if (pszEnv)
|
||||
strPath = pszEnv;
|
||||
}
|
||||
}
|
||||
|
||||
return pszPath;
|
||||
return strPath;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user