summaryrefslogtreecommitdiff
path: root/tests/testsplitheaders.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-01-07 12:44:34 -0500
committerMatthias Clasen <mclasen@redhat.com>2014-01-07 13:45:55 -0500
commit0f9f3e8fa284ce73180c7b594d37f724e089a8ce (patch)
tree2233c93310b76cadf759fd2e4e8ca31a63bf3af3 /tests/testsplitheaders.c
parent41d59985d799b9b9d557c6637691fefd671f26a0 (diff)
downloadgtk+-0f9f3e8fa284ce73180c7b594d37f724e089a8ce.tar.gz
Make testsplitheaders more robust
Same empty string issue that I fixed in GtkHeaderBar a few days ago.
Diffstat (limited to 'tests/testsplitheaders.c')
-rw-r--r--tests/testsplitheaders.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/testsplitheaders.c b/tests/testsplitheaders.c
index 38ec298c7e..5becbdb0c3 100644
--- a/tests/testsplitheaders.c
+++ b/tests/testsplitheaders.c
@@ -16,8 +16,12 @@ split_decorations (GtkSettings *settings,
p = g_strsplit (layout, ":", -1);
- p1 = g_strconcat (p[0], ":", NULL);
- p2 = g_strconcat (":", p[1], NULL);
+ p1 = g_strconcat ("", p[0], ":", NULL);
+
+ if (g_strv_length (p) >= 2)
+ p2 = g_strconcat (":", p[1], NULL);
+ else
+ p2 = g_strdup ("");
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (sheader), p1);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (mheader), p2);