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 36be153 + c08df14 commit 6d3e42bCopy full SHA for 6d3e42b
compat/mingw.c
@@ -1164,8 +1164,13 @@ char *mingw_getcwd(char *pointer, int len)
1164
if (hnd != INVALID_HANDLE_VALUE) {
1165
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1166
CloseHandle(hnd);
1167
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1168
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1169
1170
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1171
+ return NULL;
1172
+ }
1173
1174
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1175
return NULL;
1176
return pointer;
0 commit comments