Skip to content

Commit

Permalink
Merge Git for Windows v2.42.0(2) (#603)
Browse files Browse the repository at this point in the history
Git for Windows v2.42.0(2) comes with a few important fixes, most notably
fixing the slow startup of the MSYS2 runtime and the umlaut problem with
libcurl. Full release notes:
https://github.com/git-for-windows/build-extra/blob/main/ReleaseNotes.md#changes-since-git-for-windows-v2420-august-21st-2023
(the Git LFS bug does not affect v2.42.0.vfs.0.1 because that already
included the correct Git LFS version).
  • Loading branch information
dscho authored Aug 31, 2023
2 parents dd2d7ed + 2f819d1 commit 6d120bf
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions compat/lazyload-curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,24 @@ static void *load_library(const char *name)
dll_path[len] = '/';
memcpy(dll_path + len + 1, name, name_size);

if (!access(dll_path, R_OK))
return (void *)LoadLibraryExA(dll_path, NULL, 0);
if (!access(dll_path, R_OK)) {
wchar_t wpath[MAX_PATH];
int wlen = MultiByteToWideChar(CP_UTF8, 0, dll_path, -1, wpath, ARRAY_SIZE(wpath));
void *res = wlen ? (void *)LoadLibraryExW(wpath, NULL, 0) : NULL;
if (!res) {
DWORD err = GetLastError();
char buf[1024];

if (!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_ARGUMENT_ARRAY |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, LANG_NEUTRAL,
buf, sizeof(buf) - 1, NULL))
xsnprintf(buf, sizeof(buf), "last error: %ld", err);
error("LoadLibraryExW() failed with: %s", buf);
}
return res;
}
}

path = *sep ? sep + 1 : NULL;
Expand Down

0 comments on commit 6d120bf

Please sign in to comment.