From d0d48b42763ec8649196fbf7648ad9de0127dc27 Mon Sep 17 00:00:00 2001 From: djelinski <30433125+djelinski@users.noreply.github.com> Date: Wed, 25 Jul 2018 14:01:55 +0200 Subject: [PATCH] system_win32: fix version checking In the current version, VERSION_GREATER_THAN_EQUAL 6.3 will return false when run on windows 10.0. This patch addresses that error. Closes https://github.com/curl/curl/pull/2792 --- lib/system_win32.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/system_win32.c b/lib/system_win32.c index cfbbf3279..89d648516 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -134,8 +134,9 @@ bool Curl_verify_windows_version(const unsigned int majorVersion, break; case VERSION_LESS_THAN_EQUAL: - if(osver.dwMajorVersion <= majorVersion && - osver.dwMinorVersion <= minorVersion) + if(osver.dwMajorVersion < majorVersion || + (osver.dwMajorVersion == majorVersion && + osver.dwMinorVersion <= minorVersion)) matched = TRUE; break; @@ -146,8 +147,9 @@ bool Curl_verify_windows_version(const unsigned int majorVersion, break; case VERSION_GREATER_THAN_EQUAL: - if(osver.dwMajorVersion >= majorVersion && - osver.dwMinorVersion >= minorVersion) + if(osver.dwMajorVersion > majorVersion || + (osver.dwMajorVersion == majorVersion && + osver.dwMinorVersion >= minorVersion)) matched = TRUE; break;