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 19f1a67 + c467230 commit 9bbdc5aCopy full SHA for 9bbdc5a
compat/mingw.c
@@ -1082,8 +1082,13 @@ char *mingw_getcwd(char *pointer, int len)
1082
if (hnd != INVALID_HANDLE_VALUE) {
1083
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1084
CloseHandle(hnd);
1085
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1086
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1087
1088
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1089
+ return NULL;
1090
+ }
1091
1092
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1093
return NULL;
1094
return pointer;
0 commit comments