diff options
author | Richard Hughes <richard@hughsie.com> | 2016-08-15 09:55:07 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-08-15 09:55:07 +0100 |
commit | 5c6f120c1e69049b73bc20a4e357f04454f35a26 (patch) | |
tree | de7effbf4d783ee1194940d5d89b47cbc3e67b6f /libappstream-glib | |
parent | 06c8469f53fae015c067d35c2ba5dc065bf6262d (diff) | |
download | appstream-glib-5c6f120c1e69049b73bc20a4e357f04454f35a26.tar.gz |
Don't merge LangPack entries
Be more careful removing suffixes in components.
Diffstat (limited to 'libappstream-glib')
-rw-r--r-- | libappstream-glib/as-app.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libappstream-glib/as-app.c b/libappstream-glib/as-app.c index ee32f67..7b72d36 100644 --- a/libappstream-glib/as-app.c +++ b/libappstream-glib/as-app.c @@ -1970,6 +1970,12 @@ as_app_set_id (AsApp *app, const gchar *id) { AsAppPrivate *priv = GET_PRIVATE (app); gchar *tmp; + guint i; + const gchar *suffixes[] = { + ".desktop", + ".addon", + ".firmware", + NULL }; /* handle untrusted */ if ((priv->trust_flags & AS_APP_TRUST_FLAG_CHECK_VALID_UTF8) > 0 && @@ -1986,9 +1992,11 @@ as_app_set_id (AsApp *app, const gchar *id) g_free (priv->id_filename); priv->id_filename = g_strdup (as_app_get_id_no_prefix (app)); g_strdelimit (priv->id_filename, "&<>", '-'); - tmp = g_strrstr_len (priv->id_filename, -1, "."); - if (tmp != NULL) - *tmp = '\0'; + for (i = 0; suffixes[i] != NULL; i++) { + tmp = g_strrstr_len (priv->id_filename, -1, suffixes[i]); + if (tmp != NULL) + *tmp = '\0'; + } } /** |