Compare shorter "boolean" values first.
authorTobias Brunner <tobias@strongswan.org>
Thu, 18 Nov 2010 12:47:43 +0000 (13:47 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 3 Dec 2010 16:40:52 +0000 (17:40 +0100)
src/libstrongswan/settings.c

index a776664..0ecc5b5 100644 (file)
@@ -359,17 +359,17 @@ inline bool settings_value_as_bool(char *value, bool def)
 {
        if (value)
        {
-               if (strcaseeq(value, "true") ||
-                       strcaseeq(value, "enabled") ||
+               if (strcaseeq(value, "1") ||
                        strcaseeq(value, "yes") ||
-                       strcaseeq(value, "1"))
+                       strcaseeq(value, "true") ||
+                       strcaseeq(value, "enabled"))
                {
                        return TRUE;
                }
-               else if (strcaseeq(value, "false") ||
-                                strcaseeq(value, "disabled") ||
+               else if (strcaseeq(value, "0") ||
                                 strcaseeq(value, "no") ||
-                                strcaseeq(value, "0"))
+                                strcaseeq(value, "false") ||
+                                strcaseeq(value, "disabled"))
                {
                        return FALSE;
                }