mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-02 17:14:01 -05:00
fixup! http: support lazy-loading libcurl also on Windows
If the `.dll` file could not be loaded, let's print an error message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -56,8 +56,22 @@ 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)) {
|
||||
void *res = (void *)LoadLibraryExA(dll_path, NULL, 0);
|
||||
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("LoadLibraryExA() failed with: %s", buf);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
path = *sep ? sep + 1 : NULL;
|
||||
|
||||
Reference in New Issue
Block a user