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