From b64fb397012307b076b4402762145f3cba8dc380 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 24 Dec 2011 16:37:25 +0100 Subject: [PATCH] xbps_remove_pkg_from_dict_by_name: simplify. --- include/xbps_api.h | 2 +- lib/plist_remove.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/xbps_api.h b/include/xbps_api.h index db628dbc..e004970a 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,7 +56,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.3" -#define XBPS_API_VERSION "20111224-1" +#define XBPS_API_VERSION "20111224-2" #define XBPS_VERSION "0.12" /** diff --git a/lib/plist_remove.c b/lib/plist_remove.c index 48758ff3..b3817953 100644 --- a/lib/plist_remove.c +++ b/lib/plist_remove.c @@ -126,13 +126,12 @@ xbps_remove_pkg_from_dict_by_name(prop_dictionary_t dict, assert(pkgname != NULL); array = prop_dictionary_get(dict, key); - if (array == NULL) + if (array == NULL) { + errno = ENOENT; return false; + } - if (!xbps_remove_pkg_from_array_by_name(array, pkgname)) - return false; - - return prop_dictionary_set(dict, key, array); + return xbps_remove_pkg_from_array_by_name(array, pkgname); } bool