From 609a31ea46a9f8796566e8727f32e4da422c64c1 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 24 Sep 2013 12:43:40 -0400 Subject: [PATCH] loginManager: fix versionCompare function It's important to compare the version components as integers, not strings, so "10" evaulates as greater than "5" This fixes the login screen in gnome 3.10. https://bugzilla.gnome.org/show_bug.cgi?id=708691 --- js/misc/loginManager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index 62357eafb..4b0fd0622 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -72,8 +72,10 @@ function versionCompare(required, reference) { reference = reference.split('.'); for (let i = 0; i < required.length; i++) { - if (required[i] != reference[i]) - return required[i] < reference[i]; + let requiredInt = parseInt(required[i]); + let referenceInt = parseInt(reference[i]); + if (requiredInt != referenceInt) + return requiredInt < referenceInt; } return true;