-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load libcurl-4.dll
correctly even when there are umlauts in its absolute path
#4575
Load libcurl-4.dll
correctly even when there are umlauts in its absolute path
#4575
Conversation
If the `.dll` file could not be loaded, let's print an error message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
compat/lazyload-curl.c
Outdated
NULL, err, LANG_NEUTRAL, | ||
buf, sizeof(buf) - 1, NULL)) | ||
xsnprintf(buf, sizeof(buf), "last error: %ld", err); | ||
error("LoadLibraryExA() failed with: %s", buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this error message mention LoadLibraryExW()
instead as it's the function that is actually used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow `libcurl-4.dll` to be located in a path containing non-ASCII characters. This fixes git-for-windows#4573. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
55a4fd4
to
2f819d1
Compare
/git-artifacts The |
/add release note bug As of Git for Windows v2.41.0, when installed into a location whose path contains non-ASCII characters, it was no longer possible to fetch from/push to remote repositories via https://, which has been fixed. The workflow run was started |
As of Git for Windows v2.41.0, when installed into a location whose path contains non-ASCII characters, [it was no longer possible to fetch from/push to remote repositories via https://](git-for-windows/git#4573), which [has been fixed](git-for-windows/git#4575). Signed-off-by: gitforwindowshelper[bot] <gitforwindowshelper-bot@users.noreply.github.com>
/release The |
For historical reasons, the Win32 API provides
*A()
and*W()
versions of many functions, e.g.LoadLibraryExA()
andLoadLibraryExW()
. The difference between these two function families is that the latter works on wide-character Unicode strings while the former accepts localized single- and multi-byte character sequences.In Git for Windows's source code, we should not use the
*A()
family of functions at all because we use UTF-8 internally, which is not typically the current locale, and therefore the*A()
functions will most often do unintended things. However, that's exactly what I did in #4410: usingLoadLibraryExA()
(I do not remember why, but can guess that I used it for testing and intended to replace it with the*W()
invocation once everything works).In this instance, the use of an
*A()
function prevents thelibcurl-4.dll
from being loaded correctly if its absolute path contains non-ASCII characters.Let's fix this, and for good measure offer some sort of error message.
This fixes #4573.