diff options
author | Michael Schroeder <mls@suse.de> | 2020-02-14 15:52:15 +0100 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2020-02-24 11:38:13 +0200 |
commit | 02e1f3bc3a7225dedf5bad2a67872644d95655aa (patch) | |
tree | b75fc22a7d2cce8970a837b46630e9cf7148f307 /lib/fprint.c | |
parent | 153c5c219844f0f294862c9043b20f4d24f7fa69 (diff) | |
download | rpm-02e1f3bc3a7225dedf5bad2a67872644d95655aa.tar.gz |
fpLookupSubdir: get rid of a poolid->str->poolid roundtrip
Use doLookupId() instead of doLookup() so that we can reuse
the baseNameId.
Diffstat (limited to 'lib/fprint.c')
-rw-r--r-- | lib/fprint.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/fprint.c b/lib/fprint.c index 5cae13b3c..bb624212b 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -372,7 +372,7 @@ static void fpLookupSubdir(rpmFpHash symlinks, fingerPrintCache fpc, fingerPrint rpmfiles foundfi = rpmteFiles(recs[i].p); char const *linktarget = rpmfilesFLink(foundfi, recs[i].fileno); char *link; - const char *bn; + rpmsid linkId; /* Ignore already removed (by eg %pretrans) links */ if (linktarget && rpmteType(recs[i].p) == TR_REMOVED) { @@ -399,15 +399,13 @@ static void fpLookupSubdir(rpmFpHash symlinks, fingerPrintCache fpc, fingerPrint rstrscat(&link, dn, subDir ? subDir : "", "/", NULL); } rstrscat(&link, linktarget, "/", NULL); - if (strlen(currentsubdir + bnEnd)) { + if (currentsubdir[bnEnd]) rstrscat(&link, currentsubdir + bnEnd, NULL); - } - - bn = rpmstrPoolStr(fpc->pool, fp->baseNameId); - doLookup(fpc, link, bn, fp); /* modifies the fingerprint! */ - + linkId = rpmstrPoolId(fpc->pool, link, 1); free(link); + /* this modifies the fingerprint! */ + doLookupId(fpc, linkId, fp->baseNameId, fp); found = 1; break; } |