Avoid the string copy in rpmalAllFileSatisfiesDepend() now that we can

This commit is contained in:
Panu Matilainen 2012-09-18 06:26:34 +03:00
parent 4c75ab28b8
commit da9361f2d6
1 changed files with 1 additions and 5 deletions

View File

@ -319,14 +319,10 @@ static rpmte * rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds)
availableIndexEntry result;
int resultCnt = 0;
size_t bnStart = (slash - fileName) + 1;
char dirName[bnStart + 1];
struct fileNameEntry_s fne;
strncpy(dirName, fileName, bnStart);
dirName[bnStart] = '\0';
fne.baseName = rpmstrPoolId(al->pool, fileName + bnStart, 0);
fne.dirName = rpmstrPoolId(al->pool, dirName, 0);
fne.dirName = rpmstrPoolIdn(al->pool, fileName, bnStart, 0);
rpmalFileHashGetEntry(al->fileHash, fne, &result, &resultCnt, NULL);