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 1b1cb8295b
commit 724863c275

View File

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