[gnome-software/1161-licenseref-proprietary-only-recognised-case-sensitively] GsApp: LicenseRef-proprietary only recognized case-sensitively
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1161-licenseref-proprietary-only-recognised-case-sensitively] GsApp: LicenseRef-proprietary only recognized case-sensitively
- Date: Wed, 3 Mar 2021 08:52:44 +0000 (UTC)
commit 92f6f6e35c38811562d1122c0134cce51fc868e8
Author: Milan Crha <mcrha redhat com>
Date: Wed Mar 3 09:50:27 2021 +0100
GsApp: LicenseRef-proprietary only recognized case-sensitively
Let the "LicenseRef-proprietary" prefix of the application license be
case insensitive. The freedesktop.org page [1] mentions different
cases too.
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1161
[1] https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-project_license
lib/gs-app.c | 2 +-
src/gs-details-page.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 4be4e3a7a..5a17dea51 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -2610,7 +2610,7 @@ gs_app_get_license_token_is_nonfree (const gchar *token)
return FALSE;
/* a token, but still nonfree */
- if (g_str_has_prefix (token, "@LicenseRef-proprietary"))
+ if (g_ascii_strncasecmp (token, "@LicenseRef-proprietary", strlen ("@LicenseRef-proprietary")) == 0)
return TRUE;
/* if it has a prefix, assume it is free */
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 5e61cb12f..c034ce513 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -2667,7 +2667,7 @@ gs_details_page_license_nonfree_cb (GtkWidget *widget, GsDetailsPage *self)
/* license specified as a link */
tokens = as_spdx_license_tokenize (gs_app_get_license (self->app));
for (guint i = 0; tokens[i] != NULL; i++) {
- if (g_str_has_prefix (tokens[i], "@LicenseRef-proprietary=")) {
+ if (g_ascii_strncasecmp (tokens[i], "@LicenseRef-proprietary=", strlen
("@LicenseRef-proprietary=")) == 0) {
uri = g_strdup (tokens[i] + 24);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]