|
|
|
@ -1046,14 +1046,14 @@ void DetermineBasePaths(const char *exe)
|
|
|
|
|
TCHAR path[MAX_PATH];
|
|
|
|
|
#ifdef WITH_PERSONAL_DIR
|
|
|
|
|
SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, path);
|
|
|
|
|
strncpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lengthof(tmp));
|
|
|
|
|
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
|
|
|
|
AppendPathSeparator(tmp, MAX_PATH);
|
|
|
|
|
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
|
|
|
|
AppendPathSeparator(tmp, MAX_PATH);
|
|
|
|
|
_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
|
|
|
|
|
|
|
|
|
|
SHGetFolderPath(NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, path);
|
|
|
|
|
strncpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lengthof(tmp));
|
|
|
|
|
strecpy(tmp, WIDE_TO_MB_BUFFER(path, tmp, lengthof(tmp)), lastof(tmp));
|
|
|
|
|
AppendPathSeparator(tmp, MAX_PATH);
|
|
|
|
|
ttd_strlcat(tmp, PERSONAL_DIR, MAX_PATH);
|
|
|
|
|
AppendPathSeparator(tmp, MAX_PATH);
|
|
|
|
@ -1078,7 +1078,7 @@ void DetermineBasePaths(const char *exe)
|
|
|
|
|
DEBUG(misc, 0, "GetFullPathName failed (%d)\n", GetLastError());
|
|
|
|
|
_searchpaths[SP_BINARY_DIR] = NULL;
|
|
|
|
|
} else {
|
|
|
|
|
strncpy(tmp, WIDE_TO_MB_BUFFER(exec_dir, tmp, lengthof(tmp)), lengthof(tmp));
|
|
|
|
|
strecpy(tmp, WIDE_TO_MB_BUFFER(exec_dir, tmp, lengthof(tmp)), lastof(tmp));
|
|
|
|
|
char *s = strrchr(tmp, PATHSEPCHAR);
|
|
|
|
|
*(s + 1) = '\0';
|
|
|
|
|
_searchpaths[SP_BINARY_DIR] = strdup(tmp);
|
|
|
|
|