diff options
-rw-r--r-- | win32/mingw.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index eef3ab5d3..a8170bb9c 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1551,7 +1551,9 @@ static char *resolve_symlinks(char *path) | |||
1551 | FILE_FLAG_BACKUP_SEMANTICS, NULL); | 1551 | FILE_FLAG_BACKUP_SEMANTICS, NULL); |
1552 | if (h != INVALID_HANDLE_VALUE) { | 1552 | if (h != INVALID_HANDLE_VALUE) { |
1553 | if (!INIT_PROC_ADDR(kernel32.dll, GetFinalPathNameByHandleA)) { | 1553 | if (!INIT_PROC_ADDR(kernel32.dll, GetFinalPathNameByHandleA)) { |
1554 | errno = ENOSYS; | 1554 | if (resolve) |
1555 | strcpy(path, resolve); | ||
1556 | ptr = path; | ||
1555 | goto end; | 1557 | goto end; |
1556 | } | 1558 | } |
1557 | 1559 | ||
@@ -1562,7 +1564,9 @@ static char *resolve_symlinks(char *path) | |||
1562 | ptr = normalize_ntpathA(path); | 1564 | ptr = normalize_ntpathA(path); |
1563 | goto end; | 1565 | goto end; |
1564 | } else if (err_win_to_posix() == ENOSYS) { | 1566 | } else if (err_win_to_posix() == ENOSYS) { |
1565 | ptr = xstrdup(path); | 1567 | if (resolve) |
1568 | strcpy(path, resolve); | ||
1569 | ptr = path; | ||
1566 | goto end; | 1570 | goto end; |
1567 | } | 1571 | } |
1568 | } | 1572 | } |