[gtk+] Make testsplitheaders more robust
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make testsplitheaders more robust
- Date: Tue, 7 Jan 2014 18:46:19 +0000 (UTC)
commit 0f9f3e8fa284ce73180c7b594d37f724e089a8ce
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 7 12:44:34 2014 -0500
Make testsplitheaders more robust
Same empty string issue that I fixed in GtkHeaderBar a few days
ago.
tests/testsplitheaders.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/testsplitheaders.c b/tests/testsplitheaders.c
index 38ec298..5becbdb 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]