summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-05-27 14:25:59 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-05-27 15:24:34 +0300
commit45522ad7f0f22f0023f40cf4acabd4ab51011c47 (patch)
treef225ac28470a2d3fc06a036ba798938d7f9b0c46 /build
parent36538f6228abc8cd76d76f3bc7bab9d224217e1e (diff)
downloadlibrpm-tizen-45522ad7f0f22f0023f40cf4acabd4ab51011c47.tar.gz
librpm-tizen-45522ad7f0f22f0023f40cf4acabd4ab51011c47.tar.bz2
librpm-tizen-45522ad7f0f22f0023f40cf4acabd4ab51011c47.zip
Move build restriction header copying to local scope
- Eliminates accidental use of the variables, eliminating any need for NULL'ing the iterator
Diffstat (limited to 'build')
-rw-r--r--build/parseSpec.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 975867a77..9c114bbdd 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -445,8 +445,6 @@ static const rpmTagVal sourceTags[] = {
static void initSourceHeader(rpmSpec spec)
{
- HeaderIterator hi;
- struct rpmtd_s td;
struct Source *srcPtr;
spec->sourceHeader = headerNew();
@@ -454,14 +452,17 @@ static void initSourceHeader(rpmSpec spec)
headerCopyTags(spec->packages->header, spec->sourceHeader, sourceTags);
/* Add the build restrictions */
- hi = headerInitIterator(spec->buildRestrictions);
- while (headerNext(hi, &td)) {
- if (rpmtdCount(&td) > 0) {
- (void) headerPut(spec->sourceHeader, &td, HEADERPUT_DEFAULT);
+ {
+ HeaderIterator hi = headerInitIterator(spec->buildRestrictions);
+ struct rpmtd_s td;
+ while (headerNext(hi, &td)) {
+ if (rpmtdCount(&td) > 0) {
+ (void) headerPut(spec->sourceHeader, &td, HEADERPUT_DEFAULT);
+ }
+ rpmtdFreeData(&td);
}
- rpmtdFreeData(&td);
+ headerFreeIterator(hi);
}
- hi = headerFreeIterator(hi);
if (spec->BANames && spec->BACount > 0) {
headerPutStringArray(spec->sourceHeader, RPMTAG_BUILDARCHS,