aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/mingw.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 2cf4a45a2..86dc75861 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1099,12 +1099,10 @@ static char *gethomedir(void)
1099static char *getsysdir(void) 1099static char *getsysdir(void)
1100{ 1100{
1101 static char *buf = NULL; 1101 static char *buf = NULL;
1102 char dir[PATH_MAX];
1103 1102
1104 if (!buf) { 1103 if (!buf) {
1105 buf = xzalloc(PATH_MAX); 1104 buf = xzalloc(PATH_MAX);
1106 GetSystemDirectory(dir, PATH_MAX); 1105 GetSystemDirectory(buf, PATH_MAX);
1107 realpath(dir, buf);
1108 } 1106 }
1109 return buf; 1107 return buf;
1110} 1108}
@@ -2353,10 +2351,7 @@ void *get_proc_addr(const char *dll, const char *function,
2353 * on Windows 7. If it does, retry using LoadLibrary with an 2351 * on Windows 7. If it does, retry using LoadLibrary with an
2354 * explicit, backslash-separated path. */ 2352 * explicit, backslash-separated path. */
2355 if (!hnd) { 2353 if (!hnd) {
2356 char dir[PATH_MAX], *path; 2354 char *path = concat_path_file(getsysdir(), dll);
2357
2358 GetSystemDirectory(dir, PATH_MAX);
2359 path = concat_path_file(dir, dll);
2360 slash_to_bs(path); 2355 slash_to_bs(path);
2361 hnd = LoadLibrary(path); 2356 hnd = LoadLibrary(path);
2362 free(path); 2357 free(path);