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 6a828c7 + aecb88a commit 32c291fCopy full SHA for 32c291f
compat/mingw.c
@@ -1230,8 +1230,13 @@ char *mingw_getcwd(char *pointer, int len)
1230
if (hnd != INVALID_HANDLE_VALUE) {
1231
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1232
CloseHandle(hnd);
1233
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1234
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1235
1236
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1237
+ return NULL;
1238
+ }
1239
1240
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1241
return NULL;
1242
return pointer;
0 commit comments