Commit a756c801 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[1722] fix tab escape in whitespace replacer

parent e202628c
......@@ -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);
}
}
......
......@@ -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";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment