]> granicus.if.org Git - pdns/commitdiff
no longer get confused by empty lines in the forward-zones-file. again discovered...
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 2 Mar 2010 17:58:09 +0000 (17:58 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 2 Mar 2010 17:58:09 +0000 (17:58 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1533 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/reczones.cc

index bb6ca52d33fed103fe01d34bb4c356d454d96685..98556ba0c3c76c9326af03cfff2c4d35c7cfcb7f 100644 (file)
@@ -358,6 +358,9 @@ SyncRes::domainmap_t* parseAuthAndForwards()
       tie(domain, instructions)=splitField(line, '=');
       trim(domain);
       trim(instructions);
+      if(domain.empty() && instructions.empty()) { // empty line
+        continue;
+      }
       if(boost::starts_with(domain,"+")) {
         domain=domain.c_str()+1;
         ad.d_rdForward = true;
@@ -365,7 +368,7 @@ SyncRes::domainmap_t* parseAuthAndForwards()
       else
         ad.d_rdForward = false;
       if(domain.empty()) {
-       delete newMap;
+        delete newMap;
         throw AhuException("Error parsing line "+lexical_cast<string>(linenum)+" of " +::arg()["forward-zones-file"]);
       }
 
@@ -373,7 +376,7 @@ SyncRes::domainmap_t* parseAuthAndForwards()
         convertServersForAD(instructions, ad, ",; ", false);
       }
       catch(...) {
-       delete newMap;
+        delete newMap;
         throw AhuException("Conversion error parsing line "+lexical_cast<string>(linenum)+" of " +::arg()["forward-zones-file"]);
       }