diff options
author | jbj <devnull@localhost> | 1999-08-06 22:52:49 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 1999-08-06 22:52:49 +0000 |
commit | 64c9a2d1cfa65f039eca023311d46a759556c63b (patch) | |
tree | 6a33497525c23dbb78f6d9d622a33bccee287974 /lib/depends.c | |
parent | 0343b15e5511e3b5b99cbc7e8e712aed9589b487 (diff) | |
download | librpm-tizen-64c9a2d1cfa65f039eca023311d46a759556c63b.tar.gz librpm-tizen-64c9a2d1cfa65f039eca023311d46a759556c63b.tar.bz2 librpm-tizen-64c9a2d1cfa65f039eca023311d46a759556c63b.zip |
Use headerNVR throughout.
More const's.
CVS patchset: 3216
CVS date: 1999/08/06 22:52:49
Diffstat (limited to 'lib/depends.c')
-rw-r--r-- | lib/depends.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/depends.c b/lib/depends.c index 91b6859ee..e08609257 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -5,12 +5,15 @@ #include "depends.h" #include "misc.h" -static int headerNVR(Header h, const char **np, const char **vp, const char **rp) +int headerNVR(Header h, const char **np, const char **vp, const char **rp) { int type, count; - headerGetEntry(h, RPMTAG_NAME, &type, (void **) np, &count); - headerGetEntry(h, RPMTAG_VERSION, &type, (void **) vp, &count); - headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) rp, &count); + if (np && !headerGetEntry(h, RPMTAG_NAME, &type, (void **) np, &count)) + *np = NULL; + if (vp && !headerGetEntry(h, RPMTAG_VERSION, &type, (void **) vp, &count)) + *vp = NULL; + if (rp && !headerGetEntry(h, RPMTAG_RELEASE, &type, (void **) rp, &count)) + *rp = NULL; return 0; } @@ -54,8 +57,8 @@ static void alFree(struct availableList * al) if (al->list[i].relocs) { r = al->list[i].relocs; while (r->oldPath || r->newPath) { - if (r->oldPath) free(r->oldPath); - if (r->newPath) free(r->newPath); + if (r->oldPath) xfree(r->oldPath); + if (r->newPath) xfree(r->newPath); r++; } @@ -511,8 +514,7 @@ int headerMatchesDepFlags(Header h, const char *reqName, const char * reqInfo, i sprintf(buf, "%d", *epochval); epoch = buf; } - headerGetEntry(h, RPMTAG_VERSION, &type, (void **)&version, &count); - headerGetEntry(h, RPMTAG_RELEASE, &type, (void **)&release, &count); + headerNVR(h, NULL, &version, &release); /* Parse requires version into components */ Revr = strdup(reqInfo); |