Skip to content

Commit 55a4fd4

Browse files
committed
fixup! http: support lazy-loading libcurl also on Windows
Allow `libcurl-4.dll` to be located in a path containing non-ASCII characters. This fixes #4573. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b295827 commit 55a4fd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compat/lazyload-curl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ static void *load_library(const char *name)
5757
memcpy(dll_path + len + 1, name, name_size);
5858

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

0 commit comments

Comments
 (0)