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 b3a3744 + 8f5891c commit 2e6c880Copy full SHA for 2e6c880
compat/mingw.c
@@ -1257,8 +1257,13 @@ char *mingw_getcwd(char *pointer, int len)
1257
if (hnd != INVALID_HANDLE_VALUE) {
1258
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1259
CloseHandle(hnd);
1260
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1261
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1262
1263
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1264
+ return NULL;
1265
+ }
1266
1267
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1268
return NULL;
1269
return pointer;
0 commit comments