diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-09-14 15:03:21 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-09-14 15:04:26 +0300 |
commit | 1770fca303c5c5abdb27040649b458b594948238 (patch) | |
tree | df0aa99df66e38d784eb4f02074200ddee4a9caa /lib/fprint.c | |
parent | 2dc56393a25376dc69a6151f685a24cc9f34bcdc (diff) | |
download | rpm-1770fca303c5c5abdb27040649b458b594948238.tar.gz |
Change fpLookupList() to operate on pool id's only
Diffstat (limited to 'lib/fprint.c')
-rw-r--r-- | lib/fprint.c | 17 |
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; |