summaryrefslogtreecommitdiff
path: root/lib/fprint.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-14 15:03:21 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-14 15:04:26 +0300
commit1770fca303c5c5abdb27040649b458b594948238 (patch)
treedf0aa99df66e38d784eb4f02074200ddee4a9caa /lib/fprint.c
parent2dc56393a25376dc69a6151f685a24cc9f34bcdc (diff)
downloadrpm-1770fca303c5c5abdb27040649b458b594948238.tar.gz
Change fpLookupList() to operate on pool id's only
Diffstat (limited to 'lib/fprint.c')
-rw-r--r--lib/fprint.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/fprint.c b/lib/fprint.c
index 2e9b50fc3..c9f079802 100644
--- a/lib/fprint.c
+++ b/lib/fprint.c
@@ -324,6 +324,13 @@ fingerPrint * fpLookupList(fingerPrintCache cache, rpmstrPool pool,
fingerPrint * fps = xmalloc(fileCount * sizeof(*fps));
int i;
+ /*
+ * We could handle different pools easily enough, but there should be
+ * no need for that. Make sure we catch any oddball cases there might be
+ * lurking about.
+ */
+ assert(cache->pool == pool);
+
for (i = 0; i < fileCount; i++) {
/* If this is in the same directory as the last file, don't bother
redoing all of this work */
@@ -331,14 +338,10 @@ fingerPrint * fpLookupList(fingerPrintCache cache, rpmstrPool pool,
const char *bn;
fps[i].entry = fps[i - 1].entry;
fps[i].subDirId = fps[i - 1].subDirId;
- /* XXX need to copy the string while pools are different */
- bn = rpmstrPoolStr(pool, baseNames[i]);
- fps[i].baseNameId = rpmstrPoolId(cache->pool, bn, 1);
+ /* XXX if the pools are different, copy would be needed */
+ fps[i].baseNameId = baseNames[i];
} else {
- doLookup(cache,
- rpmstrPoolStr(pool, dirNames[dirIndexes[i]]),
- rpmstrPoolStr(pool, baseNames[i]),
- &fps[i]);
+ doLookupId(cache, dirNames[dirIndexes[i]], baseNames[i], &fps[i]);
}
}
return fps;