diff options
author | emersion <contact@emersion.fr> | 2018-05-04 16:21:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-04 16:21:38 +0100 |
commit | fbcbbb976c29bb2c4b1bc6aeb6331acd10c70f5f (patch) | |
tree | d5a9edbf868a0942b6a98582bdeffdbe90abd794 /sway | |
parent | 029c9b179664428db9940fe68632bbf19c3d5018 (diff) | |
parent | 3202c45054efd8e1d67b3aa48f5a46fc25a7bb57 (diff) |
Merge pull request #1912 from Hello71/patch-1
Check for NULL in container_update_title
Diffstat (limited to 'sway')
-rw-r--r-- | sway/tree/container.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 3ec58a5d..3746ad81 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -348,7 +348,7 @@ struct sway_container *container_view_create(struct sway_container *sibling, swayc, title, sibling, sibling ? sibling->type : 0, sibling->name); // Setup values swayc->sway_view = sway_view; - container_update_title(swayc, title ? title : ""); + container_update_title(swayc, title); swayc->width = 0; swayc->height = 0; @@ -660,9 +660,14 @@ static void container_notify_child_title_changed( void container_update_title(struct sway_container *container, const char *new_title) { + if (!new_title) { + new_title = ""; + } + if (container->name && strcmp(container->name, new_title) == 0) { return; } + if (container->name) { free(container->name); } |