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 a7a46df + d9ee6f1 commit e51a0a3Copy full SHA for e51a0a3
compat/mingw.c
@@ -1149,8 +1149,13 @@ char *mingw_getcwd(char *pointer, int len)
1149
if (hnd != INVALID_HANDLE_VALUE) {
1150
ret = GetFinalPathNameByHandleW(hnd, wpointer, ARRAY_SIZE(wpointer), 0);
1151
CloseHandle(hnd);
1152
- if (!ret || ret >= ARRAY_SIZE(wpointer))
1153
- return NULL;
+ if (!ret || ret >= ARRAY_SIZE(wpointer)) {
+ ret = GetLongPathNameW(cwd, wpointer, ARRAY_SIZE(wpointer));
1154
1155
+ errno = ret ? ENAMETOOLONG : err_win_to_posix(GetLastError());
1156
+ return NULL;
1157
+ }
1158
1159
if (xwcstoutf(pointer, normalize_ntpath(wpointer), len) < 0)
1160
return NULL;
1161
return pointer;
0 commit comments