]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Treat TAG_FILECOLORS as optional header element
authorMichael Schroeder <mls@suse.de>
Fri, 6 May 2016 12:12:21 +0000 (14:12 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 6 May 2016 12:12:21 +0000 (14:12 +0200)
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.

ext/repo_rpmdb.c

index 5cda891e3ccc23b7fc50bfc5cc7941ebb3a243e5..92aef31a6cf8c69781270a13fdbf5fd30cb55145 100644 (file)
@@ -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);