Load libcurl-4.dll correctly even when there are umlauts in its absolute path#4575
Merged
dscho merged 2 commits intogit-for-windows:mainfrom Aug 30, 2023
Merged
Conversation
If the `.dll` file could not be loaded, let's print an error message. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 task
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.
Should this error message mention LoadLibraryExW() instead as it's the function that is actually used?
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
Member
Author
|
/git-artifacts The |
Member
Author
|
/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 |
github-actions bot
pushed a commit
to git-for-windows/build-extra
that referenced
this pull request
Aug 30, 2023
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>
Member
Author
|
/release The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.dllfrom 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.