[gnome-shell] loginManager: fix versionCompare function



commit 609a31ea46a9f8796566e8727f32e4da422c64c1
Author: Ray Strode <rstrode redhat com>
Date:   Tue Sep 24 12:43:40 2013 -0400

    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 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index 62357ea..4b0fd06 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]