summaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0001-info-fix-a-exists-to-work-if-the-name-is-non-existan.patch
blob: a2f33ffac99fdc8d9491cf4dfbb02ed90970e0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 2cfca5b6ed658433419f9b581b3ba30f34c973c4 Mon Sep 17 00:00:00 2001
From: Timo Teras <timo.teras@iki.fi>
Date: Wed, 5 Aug 2009 19:10:54 +0300
Subject: [PATCH 1/7] info: fix a --exists to work if the name is non-existant

---
 src/info.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/info.c b/src/info.c
index a222b8c..073dc80 100644
--- a/src/info.c
+++ b/src/info.c
@@ -94,6 +94,9 @@ static int info_exists(struct info_ctx *ctx, struct apk_database *db,
 			continue;
 
 		name = dep.name;
+		if (name->pkgs == NULL)
+			continue;
+		
 		for (j = 0; j < name->pkgs->num; j++) {
 			pkg = name->pkgs->item[j];
 			if (apk_pkg_get_state(pkg) == APK_PKG_INSTALLED)
-- 
1.6.4