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 e8bf96e + 83dc45c commit f4fb6deCopy full SHA for f4fb6de
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