summaryrefslogtreecommitdiff
path: root/lib/rpmal.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-10-05 11:25:49 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-10-05 11:25:49 +0300
commit2d62d5e5c515098e1b84d93fdcf9d8b2fe8dd5df (patch)
tree44d7b514365114870dcc1c28d4e54d120939f565 /lib/rpmal.c
parent7612b1684a894a719aa273d1fe091aaa6322e0b9 (diff)
downloadrpm-2d62d5e5c515098e1b84d93fdcf9d8b2fe8dd5df.tar.gz
rpm-2d62d5e5c515098e1b84d93fdcf9d8b2fe8dd5df.tar.bz2
rpm-2d62d5e5c515098e1b84d93fdcf9d8b2fe8dd5df.zip
Avoid changing the file info sets when adding to rpmal file hash
- Use indexed access to the file info sets so we're not mucking around with somebody elses rpmfi iterator index (currently not an issue but still...)
Diffstat (limited to 'lib/rpmal.c')
-rw-r--r--lib/rpmal.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/rpmal.c b/lib/rpmal.c
index d3bac978b..1425339e8 100644
--- a/lib/rpmal.c
+++ b/lib/rpmal.c
@@ -13,6 +13,7 @@
#include "lib/misc.h"
#include "lib/rpmte_internal.h"
#include "lib/rpmds_internal.h"
+#include "lib/rpmfi_internal.h"
#include "debug.h"
@@ -179,28 +180,27 @@ static void rpmalAddFiles(rpmal al, rpmalNum pkgNum, rpmfi fi)
{
struct fileNameEntry_s fileName;
struct availableIndexEntry_s fileEntry;
- int i;
+ int fc = rpmfiFC(fi);
rpm_color_t ficolor;
int skipdoc = (al->tsflags & RPMTRANS_FLAG_NODOCS);
int skipconf = (al->tsflags & RPMTRANS_FLAG_NOCONFIGS);
fileEntry.pkgNum = pkgNum;
- fi = rpmfiInit(fi, 0);
- while ((i = rpmfiNext(fi)) >= 0) {
+ for (int i = 0; i < fc; i++) {
/* Ignore colored provides not in our rainbow. */
- ficolor = rpmfiFColor(fi);
+ ficolor = rpmfiFColorIndex(fi, i);
if (al->tscolor && ficolor && !(al->tscolor & ficolor))
continue;
/* Ignore files that wont be installed */
- if (skipdoc && (rpmfiFFlags(fi) & RPMFILE_DOC))
+ if (skipdoc && (rpmfiFFlagsIndex(fi, i) & RPMFILE_DOC))
continue;
- if (skipconf && (rpmfiFFlags(fi) & RPMFILE_CONFIG))
+ if (skipconf && (rpmfiFFlagsIndex(fi, i) & RPMFILE_CONFIG))
continue;
- fileName.dirName = rpmfiDNId(fi);
- fileName.baseName = rpmfiBNId(fi);
+ fileName.dirName = rpmfiDNIdIndex(fi, rpmfiDIIndex(fi, i));
+ fileName.baseName = rpmfiBNIdIndex(fi, i);
fileEntry.entryIx = i;