From aead2631b6b6ad3b205dbbd07da1b43d3e8d6c87 Mon Sep 17 00:00:00 2001 From: def Date: Sat, 18 Apr 2015 16:23:43 +0200 Subject: [PATCH] Fix os_compare_version a bit --- src/base/system.c | 8 ++------ src/engine/client/autoupdate.cpp | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/base/system.c b/src/base/system.c index cb89cbbc4..58d39035c 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -2371,16 +2371,12 @@ int os_compare_version(int major, int minor) mem_zero(&ver, sizeof(OSVERSIONINFO)); ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&ver); - if(ver.dwMajorVersion > major && ver.dwMinorVersion > minor) + if(ver.dwMajorVersion > major || (ver.dwMajorVersion == major && ver.dwMinorVersion > minor)) return 1; else if(ver.dwMajorVersion == major && ver.dwMinorVersion == minor) return 0; - else if(ver.dwMajorVersion < major && ver.dwMinorVersion < minor) + else return -1; - else - return -2; -#else - #error not implemented #endif } diff --git a/src/engine/client/autoupdate.cpp b/src/engine/client/autoupdate.cpp index 3cea537ea..aa701639b 100644 --- a/src/engine/client/autoupdate.cpp +++ b/src/engine/client/autoupdate.cpp @@ -25,7 +25,7 @@ void CAutoUpdate::Init() m_pClient = Kernel()->RequestInterface(); m_pStorage = Kernel()->RequestInterface(); m_pFetcher = Kernel()->RequestInterface(); - m_IsWinXP = (os_compare_version(5, 0) == 1 && os_compare_version(6, 0) == -1); + m_IsWinXP = os_compare_version(5, 1) <= 0; } void CAutoUpdate::ProgressCallback(CFetchTask *pTask, void *pUser)