Commit 1679c959 authored by Milan Crha's avatar Milan Crha Committed by Philip Withnall
Browse files

packagekit: Package details not found when not having 4 semicolons

Correct package_id_equal() to count also with packages, which do not have
4 semicolons in the ID (like `hedgewars;1.0.0-9.fc32;x86_64;updates`).

Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1069
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/517
parent b06d8444
......@@ -433,10 +433,10 @@ package_id_equal (gconstpointer a,
{
const gchar *package_id_a = a;
const gchar *package_id_b = b;
gsize n_semicolons = 0;
gsize i, n_semicolons = 0;
/* compare up to and including the last semicolon */
for (gsize i = 0; package_id_a[i] != '\0' && package_id_b[i] != '\0'; i++) {
for (i = 0; package_id_a[i] != '\0' && package_id_b[i] != '\0'; i++) {
if (package_id_a[i] != package_id_b[i])
return FALSE;
if (package_id_a[i] == ';')
......@@ -445,7 +445,7 @@ package_id_equal (gconstpointer a,
return TRUE;
}
return FALSE;
return package_id_a[i] == package_id_b[i];
}
GHashTable *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment