diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-09-18 10:03:13 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-09-18 10:03:13 +0300 |
commit | a642de2e7f571913fff1f05526414807658b1ed0 (patch) | |
tree | 026999258d6af256025623a5cc096b7ffcd7ed39 /lib/fprint.c | |
parent | ad99f4e84a5fea05edca59257b6e00d91d6c8a08 (diff) | |
download | rpm-a642de2e7f571913fff1f05526414807658b1ed0.tar.gz |
Ensure fingerprint subdirs have heading slashes
- Similar to commit ad99f4e84a5fea05edca59257b6e00d91d6c8a08 but at the
other end of the name: not all subdirs will exist in the pool already
but none of them exists without the heading slash. Saves another handful
of megs on larger transactions.
Diffstat (limited to 'lib/fprint.c')
-rw-r--r-- | lib/fprint.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/fprint.c b/lib/fprint.c index 687561ca6..f370b37f2 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -204,12 +204,9 @@ static int doLookupId(fingerPrintCache cache, } if (fp->entry) { - const char * subDir = cdn + (end - buf); - if (subDir[0] == '/' && subDir[1] != '\0') - subDir++; - if (subDir[0] == '\0' || + const char * subDir = cdn + (end - buf) - 1; /* XXX don't bother saving '/' as subdir */ - (subDir[0] == '/' && subDir[1] == '\0')) + if (subDir[0] == '\0' || (subDir[0] == '/' && subDir[1] == '\0')) subDir = NULL; fp->baseNameId = baseNameId; if (subDir != NULL) @@ -394,7 +391,6 @@ static void fpLookupSubdir(rpmFpHash symlinks, fingerPrintCache fpc, rpmte p, in current_fp.subDirId); } rstrscat(&link, dn, - subDir ? "/" : "", subDir ? subDir : "", "/", NULL); } |