Don't support curl built by Cygwin

[GitHub #144]

Co-authored-by: Yangmoooo <yangmoooo@outlook.com>
This commit is contained in:
Aoran Zeng 2024-12-09 16:50:40 +08:00
parent c3d4bbf967
commit 1125a25e6d
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -719,6 +719,25 @@ select_mirror_autoly (Source_t *sources, size_t size, const char *target_name)
chsrc_error (msg);
exit (Exit_UserCause);
}
if (xy_on_windows)
{
char *curl_version = xy_run ("curl --version >nul 2>nul", 1, NULL);
/**
* https://github.com/RubyMetric/chsrc/issues/144
*
* Cygwin上curl :
*
* curl 8.9.1 (x86_64-pc-cygwin)
*
*/
if (strstr (curl_version, "pc-cygwin"))
{
char *msg = CliOpt_InEnglish ? "You're using curl built by Cygwin which has a bug! Please use another curl!" : "你使用的是Cygwin构建的curl该版本的curl存在bug请改用其他版本的curl";
chsrc_error (msg);
exit (Exit_UserCause);
}
}
/** --------------------------------------------- */
/* 总测速记录值 */