]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly split key/value when parsing variables (Thanks xeen)
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 20 Sep 2011 20:42:09 +0000 (21:42 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 20 Sep 2011 20:42:09 +0000 (21:42 +0100)
src/cfgparse.y

index 10ca48ccf609a4d9efff608e21b6843860ada305..f8e84ae9b3b8eeaf1f4fe707d27b9229a229c42d 100644 (file)
@@ -358,12 +358,14 @@ void parse_file(const char *f) {
 
             /* get key/value for this variable */
             char *v_key = value, *v_value;
-            if ((v_value = strstr(value, " ")) == NULL &&
-                (v_value = strstr(value, "\t")) == NULL) {
+            if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) {
                 ELOG("Malformed variable assignment, need a value\n");
                 continue;
             }
 
+            if (!(v_value = strstr(value, " ")))
+                v_value = strstr(value, "\t");
+
             *(v_value++) = '\0';
 
             struct Variable *new = scalloc(sizeof(struct Variable));