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