icontheme: Add a trailing / when enumerating resources

This avoids extra string copies in GResource.
This commit is contained in:
Matthias Clasen 2017-11-13 12:12:52 -05:00
parent e3f84e9bf4
commit 4ffdf917bb

View File

@ -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;