From: Michael Schroeder Date: Fri, 6 May 2016 12:12:21 +0000 (+0200) Subject: Treat TAG_FILECOLORS as optional header element X-Git-Tag: 0.6.21~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de623fb8e8607ec8d8d32301807d0c519eed2a1a;p=thirdparty%2Flibsolv.git Treat TAG_FILECOLORS as optional header element SUSE has a patch that makes rpmbuild not add the FILECOLORS tag. So insisting on its presence when RPM_ITERATE_FILELIST_WITHCOL is used is wrong. --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 5cda891e..92aef31a 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -2435,7 +2435,7 @@ rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char * if ((flags & RPM_ITERATE_FILELIST_WITHCOL) != 0) { co = headint32array(rpmhead, TAG_FILECOLORS, &cnt2); - if (!co || cnt != cnt2) + if (co && cnt != cnt2) { solv_free(co); solv_free(md); @@ -2513,8 +2513,7 @@ rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char * info.digest = md5; } } - if (co) - info.color = co[i]; + info.color = co ? co[i] : 0; (*cb)(cbdata, space, &info); } solv_free(space);