From 724863c2751a1feb84a89abcd9ec889f57f10f86 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Nov 2017 12:12:52 -0500 Subject: icontheme: Add a trailing / when enumerating resources This avoids extra string copies in GResource. --- gtk/gtkicontheme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gtk/gtkicontheme.c') diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index fb14e1094a..1dc44a5567 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3359,7 +3359,9 @@ theme_subdir_load (GtkIconTheme *icon_theme, { for (d = icon_theme->priv->resource_paths; d; d = d->next) { - full_dir = g_build_filename ((const gchar *)d->data, subdir, NULL); + /* Force a trailing / here, to avoid extra copies in GResource */ + full_dir = g_build_filename ((const gchar *)d->data, subdir, " ", NULL); + full_dir[strlen (full_dir) - 1] = '\0'; dir = g_new0 (IconThemeDir, 1); dir->type = type; dir->is_resource = TRUE; -- cgit v1.2.1