/* 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)
<ul>
<li>
-- <a href="http://packages.debian.org/sid/i3">Debian GNU/Linux</a> (in unstable currently)
++ <a href="http://packages.debian.org/sid/i3">Debian GNU/Linux</a>
</li>
<li>
<a href="http://aur.archlinux.org/packages.php?ID=24720">Arch Linux</a>
<h2>Downloads</h2>
<p>
-- The current stable version is 3.β (transcribed 3.b because many systems still can’t
++ The current stable version is 3.γ (transcribed 3.c because many systems still can’t
handle UTF-8 in version numbers).
</p>
<ul>
++ <li>
++ <a href="/downloads/i3-3.c.tar.bz2">i3-3.c.tar.bz2</a>
++ (<a href="/downloads/i3-3.c.tar.bz2.asc">GPG signature</a>), Version 3.γ, 107 KiB, 2009-08-19,
++ <a href="/downloads/RELEASE-NOTES-3.c.txt">release notes</a>
++
++ </li>
<li>
<a href="/downloads/i3-3.b.tar.bz2">i3-3.b.tar.bz2</a>
(<a href="/downloads/i3-3.b.tar.bz2.asc">GPG signature</a>), Version 3.β, 96 KiB, 2009-06-26,