]> git.sur5r.net Git - i3/i3/commitdiff
Correctly handle an absent window title to avoid a crash for applications that only... 1891/head
authorIngo Bürk <ingo.buerk@tngtech.com>
Fri, 4 Sep 2015 23:18:35 +0000 (01:18 +0200)
committerIngo Bürk <ingo.buerk@tngtech.com>
Fri, 4 Sep 2015 23:18:35 +0000 (01:18 +0200)
fixes #1890

src/window.c

index 278918c74eb42ecf4b829a4adfb3009a756ce4be..5ecf51c6f3aba4e6d9e2190dbe969c6bcf8a6034 100644 (file)
@@ -359,7 +359,7 @@ i3String *window_parse_title_format(i3Window *win) {
     for (char *walk = format; *walk != '\0'; walk++) {
         if (STARTS_WITH(walk, "%title")) {
             if (escaped_title == NULL)
-                escaped_title = i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
+                escaped_title = win->name == NULL ? "" : i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
 
             buffer_len = buffer_len - strlen("%title") + strlen(escaped_title);
             walk += strlen("%title") - 1;