We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 01d5eb1 + 2203b1d commit d579591Copy full SHA for d579591
compat/mingw.c
@@ -1096,8 +1096,13 @@ char *mingw_getcwd(char *pointer, int len)
1096
if (hnd != INVALID_HANDLE_VALUE) {
1097
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1098
CloseHandle(hnd);
1099
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1100
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1101
1102
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1103
+ return NULL;
1104
+ }
1105
1106
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1107
return NULL;
1108
return pointer;
0 commit comments