-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
windows: always use curl's basename() implementation #10475
Conversation
Unrelated failure while linking a test:
Possibly a regression after 5a9a04d. |
Fixes a build regression. Follow-up to 5a9a04d Reported-by: Viktor Szakats Ref: #10475 (comment)
@@ -838,6 +838,10 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, | |||
#define USE_HTTP3 | |||
#endif | |||
|
|||
#if defined(HAVE_BASENAME) && defined(WIN32) |
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.
I suggest a brief comment explaining why. Also is this a bug in mingw-w64 or is it our bug?
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.
Added a comment.
Sticking with the short example from #10261 (comment), this seems to be a mingw-w64 issue. But hard to say for certain without reproducing/debugging this with that exact (raw byte!) input and locale (and possibly the OS env). Also the original bug report is a slightly different case.
[ Just by eyeballing the source, there seems to be one bug at least, where the if (*refname)
condition is always true, so the else
branch never executes. ]
The `basename()` implementation provided by mingw-w64 [1] makes assumptions about input encoding and thus may break with non-ASCII strings. `basename()` was auto-detected with CMake, autotools and since 68fa9bf (2022-10-13), also in `Makefile.mk` after syncing its behaviour with the mainline build methods. A similar patch for curl-for-win broke official Windows builds earlier, in release 7.83.1_4 (2022-06-15). This patch forces all Windows builds to use curl's internal `basename()` implementation to avoid such problems. [1]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c Reported-by: UnicornZhang on Github Assisted-by: Cherish98 on Github Fixes curl#10261 Closes curl#10475
58c6b08
to
2580f93
Compare
Fixes a build regression. Follow-up to 5a9a04d Reported-by: Viktor Szakats Ref: #10475 (comment) Closes #10477
The `basename()` [1][2] implementation provided by mingw-w64 [3] makes assumptions about input encoding and thus may break with non-ASCII strings. `basename()` was auto-detected with CMake, autotools and since 68fa9bf (2022-10-13), also in `Makefile.mk` after syncing its behaviour with the mainline build methods. A similar patch for curl-for-win broke official Windows builds earlier, in release 7.83.1_4 (2022-06-15). This patch forces all Windows builds to use curl's internal `basename()` implementation to avoid such problems. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html [2]: https://www.man7.org/linux/man-pages/man3/basename.3.html [3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c Reported-by: UnicornZhang on Github Assisted-by: Cherish98 on Github Fixes curl#10261 Closes curl#10475
2580f93
to
14118ee
Compare
Fixes a build regression. Follow-up to 5a9a04d Reported-by: Viktor Szakats Ref: curl#10475 (comment) Closes curl#10477
The `basename()` [1][2] implementation provided by mingw-w64 [3] makes assumptions about input encoding and may break with non-ASCII strings. `basename()` was auto-detected with CMake, autotools and since 68fa9bf (2022-10-13), also in `Makefile.mk` after syncing its behaviour with the mainline build methods. A similar patch for curl-for-win broke official Windows builds earlier, in release 7.83.1_4 (2022-06-15). This patch forces all Windows builds to use curl's internal `basename()` implementation to avoid such problems. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html [2]: https://www.man7.org/linux/man-pages/man3/basename.3.html [3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c Reported-by: UnicornZhang on Github Assisted-by: Cherish98 on Github Reviewed-by: Daniel Stenberg Fixes curl#10261 Closes curl#10475
The
basename()
[1][2] implementation provided by mingw-w64 [3] makes assumptions about input encoding and may break with non-ASCII strings.basename()
was auto-detected with CMake, autotools and since 68fa9bf (2022-10-13), also inMakefile.mk
after syncing its behaviour with the mainline build methods. A similar patch for curl-for-win broke official Windows builds earlier, in release 7.83.1_4 (2022-06-15).This patch forces all Windows builds to use curl's internal
basename()
implementation to avoid such problems.[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
[2]: https://www.man7.org/linux/man-pages/man3/basename.3.html
[3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c
Reported-by: UnicornZhang on Github
Assisted-by: Cherish98 on Github
Fixes #10261
Closes #10475