From 615fff42f78201f673c064096d83691c663dff2f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 13 Jun 2008 10:27:46 +0300 Subject: [PATCH] Convert legacyRetrofit() to new headerGet() --- lib/legacy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/legacy.c b/lib/legacy.c index 50e261c..32ad4d9 100644 --- a/lib/legacy.c +++ b/lib/legacy.c @@ -210,7 +210,7 @@ exit: void legacyRetrofit(Header h) { - const char * prefix; + struct rpmtd_s dprefix; /* * We don't use these entries (and rpm >= 2 never has) and they are @@ -228,12 +228,13 @@ void legacyRetrofit(Header h) * careful. This fixup makes queries give the new values though, * which is quite handy. */ - if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (rpm_data_t *) &prefix, NULL)) - { + if (headerGet(h, RPMTAG_DEFAULTPREFIX, &dprefix, HEADERGET_MINMEM)) { + const char *prefix = rpmtdGetString(&dprefix); char * nprefix = stripTrailingChar(xstrdup(prefix), '/'); (void) headerAddEntry(h, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE, &nprefix, 1); free(nprefix); + rpmtdFreeData(&dprefix); } /* -- 2.7.4