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 cfa6a8d + 06999be commit 62b56beCopy full SHA for 62b56be
compat/mingw.c
@@ -1272,8 +1272,13 @@ char *mingw_getcwd(char *pointer, int len)
1272
if (hnd != INVALID_HANDLE_VALUE) {
1273
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1274
CloseHandle(hnd);
1275
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1276
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1277
1278
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1279
+ return NULL;
1280
+ }
1281
1282
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1283
return NULL;
1284
return pointer;
0 commit comments