From: Michael Stapelberg Date: Tue, 21 Jul 2009 14:05:43 +0000 (+0200) Subject: Bugfix: Strip trailing whitespace when parsing assignments (Thanks bapt) X-Git-Tag: 3.c~56 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=008a2665c19ca5cbd5f4cd54b2cdc6c4b8ee719d;p=i3%2Fi3 Bugfix: Strip trailing whitespace when parsing assignments (Thanks bapt) --- diff --git a/src/config.c b/src/config.c index d55c2a75..2c2ba045 100644 --- a/src/config.c +++ b/src/config.c @@ -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");