From: jbj Date: Sat, 15 Jul 2000 18:15:23 +0000 (+0000) Subject: markReplacedFiles: don't bother if nothing to do. X-Git-Tag: rpm-4.4-release~2008 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=600dfddcfbd0a4a105c3f9bee94fe2a78b437fe7;p=platform%2Fupstream%2Frpm.git markReplacedFiles: don't bother if nothing to do. CVS patchset: 3953 CVS date: 2000/07/15 18:15:23 --- diff --git a/lib/install.c b/lib/install.c index d35b17c..2189aee 100644 --- a/lib/install.c +++ b/lib/install.c @@ -426,6 +426,8 @@ static int markReplacedFiles(rpmdb db, const struct sharedFileInfo * replList) prev = fileInfo->otherPkg; num++; } + if (num == 0) + return 0; offsets = alloca(num * sizeof(*offsets)); num = prev = 0; @@ -449,10 +451,14 @@ static int markReplacedFiles(rpmdb db, const struct sharedFileInfo * replList) modified = 0; prev = rpmdbGetIteratorOffset(mi); + num = 0; while (fileInfo->otherPkg && fileInfo->otherPkg == prev) { assert(fileInfo->otherFileNum < count); - secStates[fileInfo->otherFileNum] = RPMFILE_STATE_REPLACED; - modified = 1; + if (secStates[fileInfo->otherFileNum] != RPMFILE_STATE_REPLACED) { + secStates[fileInfo->otherFileNum] = RPMFILE_STATE_REPLACED; + modified = 1; + num++; + } fileInfo++; }