diff options
author | Richard Hughes <richard@hughsie.com> | 2016-08-01 09:29:57 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-08-01 09:49:34 +0100 |
commit | 2407c740e0ff94c1e66c5448f971326753baacba (patch) | |
tree | b93a2b4860db09e2c4fa339486d9714002735a81 /libappstream-glib/as-store.c | |
parent | 0b60c91524b700d5dcdcccde23af7fc117cbcb9b (diff) | |
download | appstream-glib-2407c740e0ff94c1e66c5448f971326753baacba.tar.gz |
Include the version in the equality check
Diffstat (limited to 'libappstream-glib/as-store.c')
-rw-r--r-- | libappstream-glib/as-store.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 6c8fdb2..82eb15a 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -463,7 +463,7 @@ _as_app_new_from_unique_id (const gchar *unique_id) g_autoptr(AsApp) app = as_app_new (); split = g_strsplit (unique_id, "/", -1); - if (g_strv_length (split) != 7) + if (g_strv_length (split) != 8) return NULL; if (g_strcmp0 (split[0], AS_APP_UNIQUE_WILDCARD) != 0) as_app_set_scope (app, as_app_scope_from_string (split[1])); @@ -489,6 +489,8 @@ _as_app_new_from_unique_id (const gchar *unique_id) as_app_add_arch (app, split[5]); if (g_strcmp0 (split[6], AS_APP_UNIQUE_WILDCARD) != 0) as_app_set_branch (app, split[6]); + if (g_strcmp0 (split[7], AS_APP_UNIQUE_WILDCARD) != 0) + as_app_set_version (app, split[7]); return g_steal_pointer (&app); } @@ -537,6 +539,8 @@ as_store_get_app_by_unique_id (AsStore *store, /* create virtual app using scope/system/origin/kind/id/arch/branch */ app_tmp = _as_app_new_from_unique_id (unique_id); + if (app_tmp == NULL) + return NULL; return as_store_get_app_by_app (store, app_tmp); } |