From a51129231653d6a0848c0b2bf0094f32f20d7203 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 25 Feb 2014 18:43:33 +0100 Subject: [PATCH] lib/plist_find.c: do not return a false positive while matching vpkgs. --- lib/plist_find.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plist_find.c b/lib/plist_find.c index fe7d365a..f8736ec2 100644 --- a/lib/plist_find.c +++ b/lib/plist_find.c @@ -190,6 +190,7 @@ vpkg_user_conf(struct xbps_handle *xhp, xbps_string_t rpkg; const char *vpkgver, *pkg = NULL; char *vpkgname = NULL, *tmp; + bool found = false; if (xhp->vpkgd == NULL) return NULL; @@ -226,11 +227,12 @@ vpkg_user_conf(struct xbps_handle *xhp, xbps_dbg_printf(xhp, "matched vpkg `%s' with `%s (provides %s)`\n", vpkg, pkg, vpkgver); free(vpkgname); + found = true; break; } xbps_object_iterator_release(iter); - return pkg; + return found ? pkg : NULL; } xbps_dictionary_t