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 6188a0d + 2469d5f commit e2a48ecCopy full SHA for e2a48ec
compat/mingw.c
@@ -1142,8 +1142,13 @@ char *mingw_getcwd(char *pointer, int len)
1142
if (hnd != INVALID_HANDLE_VALUE) {
1143
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1144
CloseHandle(hnd);
1145
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1146
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1147
1148
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1149
+ return NULL;
1150
+ }
1151
1152
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1153
return NULL;
1154
return pointer;
0 commit comments