BIND 10 trac1722, updated. 56044dbf3981ebe38befdef5c9fbd499bf9e888d [1722] fix tab escape in whitespace replacer

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Feb 29 11:15:37 UTC 2012


The branch, trac1722 has been updated
       via  56044dbf3981ebe38befdef5c9fbd499bf9e888d (commit)
      from  5ebf78690a7ce8e144e307ab0529fa28f1604356 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 56044dbf3981ebe38befdef5c9fbd499bf9e888d
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Feb 29 12:12:50 2012 +0100

    [1722] fix tab escape in whitespace replacer

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/masterload.cc                |    2 +-
 src/lib/dns/tests/masterload_unittest.cc |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/masterload.cc b/src/lib/dns/masterload.cc
index 6f1e236..0b195f6 100644
--- a/src/lib/dns/masterload.cc
+++ b/src/lib/dns/masterload.cc
@@ -55,7 +55,7 @@ stripLine(string& s, const Exception& ex) {
         s.resize(pos_semicolon);
     }
     // Remove any trailing whitespace return the resulting text.
-    s.resize(s.find_last_not_of(" /t") + 1);
+    s.resize(s.find_last_not_of(" \t") + 1);
     return (s);
 }
 }
diff --git a/src/lib/dns/tests/masterload_unittest.cc b/src/lib/dns/tests/masterload_unittest.cc
index 7ec2f05..727bff3 100644
--- a/src/lib/dns/tests/masterload_unittest.cc
+++ b/src/lib/dns/tests/masterload_unittest.cc
@@ -230,6 +230,17 @@ TEST_F(MasterLoadTest, loadRRWithEOLWhitespace) {
                                       "1 0 1 beef")));
 }
 
+TEST_F(MasterLoadTest, loadRRWithEOLWhitespaceTab) {
+    // Similar to the previous one, but there's no space before comments.
+    // It should still work.
+    rr_stream << "example.com. 3600 IN NSEC3PARAM 1 0 1 beef\t\n";
+    masterLoad(rr_stream, origin, zclass, callback);
+    ASSERT_EQ(1, results.size());
+    EXPECT_EQ(0, results[0]->getRdataIterator()->getCurrent().compare(
+                  *rdata::createRdata(RRType::NSEC3PARAM(), zclass,
+                                      "1 0 1 beef")));
+}
+
 TEST_F(MasterLoadTest, loadRRNoComment) {
     // A semicolon in a character-string shouldn't confuse the parser.
     rr_stream << "example.com. 3600 IN TXT \"aaa;bbb\"\n";



More information about the bind10-changes mailing list