[gtk+/gtk-3-22] icontheme: Add a trailing / when enumerating resources



commit 4ffdf917bbdfd4feee2d01c44a04ac47efc6429d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 13 12:12:52 2017 -0500

    icontheme: Add a trailing / when enumerating resources
    
    This avoids extra string copies in GResource.

 gtk/gtkicontheme.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index acd13e0..3225567 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3398,7 +3398,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]