We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a030cf3 + 7228414 commit 06ca3dcCopy full SHA for 06ca3dc
compat/mingw.c
@@ -1231,8 +1231,13 @@ char *mingw_getcwd(char *pointer, int len)
1231
if (hnd != INVALID_HANDLE_VALUE) {
1232
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1233
CloseHandle(hnd);
1234
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1235
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1236
1237
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1238
+ return NULL;
1239
+ }
1240
1241
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1242
return NULL;
1243
return pointer;
0 commit comments