summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-21 11:04:59 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-21 12:04:51 +0300
commita668b84c95d04dc0c6cd70b93a58938e8e798b7d (patch)
treec590882b3c41ce26ccc3e17628a7bb5a6d375e83 /lib/formats.c
parentbda56cc4376c34a87ac96df06be72d64e04d03ee (diff)
downloadlibrpm-tizen-a668b84c95d04dc0c6cd70b93a58938e8e798b7d.tar.gz
librpm-tizen-a668b84c95d04dc0c6cd70b93a58938e8e798b7d.tar.bz2
librpm-tizen-a668b84c95d04dc0c6cd70b93a58938e8e798b7d.zip
Minor fixes to triggercondsTag()
- lose unused variable - remember to reset versions iterator too
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 981dc027c..5c631b3da 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -698,7 +698,6 @@ static int triggercondsTag(Header h, rpmtd td)
{
uint32_t * indices;
int i, j;
- rpm_flag_t * flags;
char ** conds;
struct rpmtd_s nametd, indextd, flagtd, versiontd, scripttd;
int hgeflags = HEADERGET_MINMEM;
@@ -718,14 +717,13 @@ static int triggercondsTag(Header h, rpmtd td)
td->count = rpmtdCount(&scripttd);
indices = indextd.data;
- flags = flagtd.data;
while ((i = rpmtdNext(&scripttd)) >= 0) {
rpm_flag_t *flag;
char *flagStr, *item;
ARGV_t items = NULL;
- rpmtdInit(&nametd); rpmtdInit(&flagtd);
+ rpmtdInit(&nametd); rpmtdInit(&flagtd); rpmtdInit(&versiontd);
while ((j = rpmtdNext(&nametd)) >= 0) {
/* flag and version arrays match name array size always */
rpmtdNext(&flagtd); rpmtdNext(&versiontd);
@@ -734,7 +732,7 @@ static int triggercondsTag(Header h, rpmtd td)
continue;
flag = rpmtdGetUint32(&flagtd);
- if (*flag & RPMSENSE_SENSEMASK) {
+ if (flag && *flag & RPMSENSE_SENSEMASK) {
flagStr = rpmtdFormat(&flagtd, RPMTD_FORMAT_DEPFLAGS, NULL);
rasprintf(&item, "%s %s %s", rpmtdGetString(&nametd),
flagStr,