]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Strip trailing whitespace when parsing assignments (Thanks bapt)
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 21 Jul 2009 14:05:43 +0000 (16:05 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 21 Jul 2009 14:06:16 +0000 (16:06 +0200)
src/config.c

index d55c2a75542a93f393c398d19c3cf60bbe4624c4..2c2ba0453e9b0a7683936a661bcbca5f9935dde7 100644 (file)
@@ -260,6 +260,10 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath)
                                 *end = '\0';
                         }
 
+                        /* Strip trailing whitespace */
+                        while (strlen(value) > 0 && value[strlen(value)-1] == ' ')
+                                value[strlen(value)-1] = '\0';
+
                         /* The target is the last argument separated by a space */
                         if ((target = strrchr(value, ' ')) == NULL)
                                 die("Malformed assignment, couldn't find target\n");