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 aeaf3f8 + a0e782b commit aff38e3Copy full SHA for aff38e3
compat/mingw.c
@@ -1237,8 +1237,13 @@ char *mingw_getcwd(char *pointer, int len)
1237
if (hnd != INVALID_HANDLE_VALUE) {
1238
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1239
CloseHandle(hnd);
1240
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1241
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1242
1243
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1244
+ return NULL;
1245
+ }
1246
1247
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1248
return NULL;
1249
return pointer;
0 commit comments