From: Michael Stapelberg Date: Wed, 19 Aug 2009 13:13:27 +0000 (+0200) Subject: Merge branch 'next' X-Git-Tag: 3.d-bf1~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ec0113f631e9603b26486af506ca6797d2e732b4;p=i3%2Fi3 Merge branch 'next' Conflicts: src/manage.c src/util.c src/xinerama.c --- ec0113f631e9603b26486af506ca6797d2e732b4 diff --cc src/config.c index 2c2ba045,a5f635dc..bc7edeab --- a/src/config.c +++ b/src/config.c @@@ -242,27 -401,26 +401,30 @@@ void load_configuration(xcb_connection_ /* assign window class[/window title] → workspace */ if (strcasecmp(key, "assign") == 0) { LOG("assign: \"%s\"\n", value); - char *class_title = sstrdup(value); + char *class_title; char *target; + char *end; /* If the window class/title is quoted we skip quotes */ - if (class_title[0] == '"') { - class_title++; - char *end = strchr(class_title, '"'); - if (end == NULL) - die("Malformed assignment, couldn't find terminating quote\n"); - *end = '\0'; + if (value[0] == '"') { + class_title = sstrdup(value+1); + end = strchr(class_title, '"'); } else { + class_title = sstrdup(value); /* If it is not quoted, we terminate it at the first space */ - char *end = strchr(class_title, ' '); - if (end == NULL) - die("Malformed assignment, couldn't find terminating space\n"); - *end = '\0'; + end = strchr(class_title, ' '); } + if (end == NULL) + die("Malformed assignment, couldn't find terminating quote\n"); + *end = '\0'; + + /* Strip trailing whitespace */ + while (strlen(value) > 0 && value[strlen(value)-1] == ' ') + value[strlen(value)-1] = '\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) diff --cc website/downloads/index.html index 9cbea01c,5e1f2045..360413a7 --- a/website/downloads/index.html +++ b/website/downloads/index.html @@@ -83,7 -64,7 +83,7 @@@ a