aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 85ca02f0aa..e2e104cc88 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -643,13 +643,17 @@ 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')
+ pszPath[0] = '\0';
{
if (nFolder == CSIDL_STARTUP)
{