From 95ed35296e811d5ed2583e9ec84f1c26ce021a39 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 16 Apr 2014 10:01:25 +0200 Subject: fix XcodeProbe::compareVersions Task-number: QBS-556 Change-Id: I1f38394a8b60aae3185901176dce9439d6ad111a Reviewed-by: Joerg Bornemann --- src/app/qbs-setup-toolchains/xcodeprobe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/qbs-setup-toolchains/xcodeprobe.cpp b/src/app/qbs-setup-toolchains/xcodeprobe.cpp index 362a45e77..38df7ff72 100644 --- a/src/app/qbs-setup-toolchains/xcodeprobe.cpp +++ b/src/app/qbs-setup-toolchains/xcodeprobe.cpp @@ -83,7 +83,7 @@ int XcodeProbe::compareVersions(const QString &v1, const QString &v2) QStringList v1L = v1.split(QLatin1Char('.')); QStringList v2L = v2.split(QLatin1Char('.')); int i = 0; - while (v1.length() > i && v1.length() > i) { + while (v1L.length() > i && v2L.length() > i) { bool n1Ok, n2Ok; int n1 = v1L.value(i).toInt(&n1Ok); int n2 = v2L.value(i).toInt(&n2Ok); @@ -97,9 +97,9 @@ int XcodeProbe::compareVersions(const QString &v1, const QString &v2) return 1; ++i; } - if (v1.length() > v2.length()) + if (v1L.length() > v2L.length()) return -1; - if (v1.length() < v2.length()) + if (v1L.length() < v2L.length()) return 1; return 0; } -- cgit v1.2.3