[gnome-software/wip/iainl/ubuntu-xenial: 284/287] apt: fix is_open_source
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/iainl/ubuntu-xenial: 284/287] apt: fix is_open_source
- Date: Tue, 12 Apr 2016 10:02:02 +0000 (UTC)
commit e0816395eb8730cc1aface67b4c85f84007ff2d7
Author: Iain Lane <iain orangesquash org uk>
Date: Tue Apr 12 09:46:44 2016 +0100
apt: fix is_open_source
src/plugins/gs-plugin-apt.cc | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.cc b/src/plugins/gs-plugin-apt.cc
index c2fa2a4..dc8407e 100644
--- a/src/plugins/gs-plugin-apt.cc
+++ b/src/plugins/gs-plugin-apt.cc
@@ -417,15 +417,16 @@ is_allowed_section (PackageInfo *info)
static gchar *
get_origin (PackageInfo *info)
{
- gchar *origin_lower = g_strdup (info->origin);
+ if (!info->origin)
+ return NULL;
+
+ g_autofree gchar *origin_lower = g_strdup (info->origin);
gchar *out;
for (int i = 0; origin_lower[i]; ++i)
- g_ascii_tolower(origin_lower[i]);
+ origin_lower[i] = g_ascii_tolower (origin_lower[i]);
out = g_strdup_printf ("%s-%s-%s", origin_lower, info->release, info->component);
- g_free (origin_lower);
-
return out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]