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