From 7baac7c61e2eabc255683c167c9fbdf495ee455d Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 22 Dec 2015 16:41:32 +0100 Subject: [PATCH] Fix logic error in zone2sql Introduced in #3019. Closes #3067 --- pdns/zone2sql.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pdns/zone2sql.cc b/pdns/zone2sql.cc index cc4ca92db..d95c5f2af 100644 --- a/pdns/zone2sql.cc +++ b/pdns/zone2sql.cc @@ -421,12 +421,14 @@ try continue; if(rr.qtype.getCode() == QType::SOA) seenSOA=true; - if(!haveEmittedZone && !zpt.getZoneName().empty()){ - emitDomain(zpt.getZoneName().toStringNoDot()); - haveEmittedZone = true; - } else { - // We have no zonename yet, don't emit - continue; + if(!haveEmittedZone) { + if(!zpt.getZoneName().empty()){ + emitDomain(zpt.getZoneName().toStringNoDot()); + haveEmittedZone = true; + } else { + // We have no zonename yet, don't emit + continue; + } } emitRecord(zpt.getZoneName().toStringNoDot(), rr.qname, rr.qtype.getName(), rr.content, rr.ttl, comment); -- 2.40.0