From: Peter van Dijk Date: Mon, 30 Nov 2015 13:51:13 +0000 (+0100) Subject: move root-dot method into dnsname X-Git-Tag: dnsdist-1.0.0-alpha1~159^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b2956667ef2eefe9fd7645f49143e259ba601af;p=pdns move root-dot method into dnsname --- diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index 4281cee36..3c1a2360b 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -41,6 +41,7 @@ public: std::string toString(const std::string& separator=".", const bool trailing=true) const; //!< Our human-friendly, escaped, representation std::string toStringNoDot() const { return toString(".", false); } + std::string toStringRootDot() const { if(isRoot()) return "."; else return toString(".", false); } std::string toDNSString() const; //!< Our representation in DNS native format void appendRawLabel(const std::string& str); //!< Append this unescaped label void appendRawLabel(const char* start, unsigned int length); //!< Append this unescaped label diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index 30390108d..0b691d671 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -510,10 +510,7 @@ void RecordTextWriter::xfrName(const DNSName& val, bool, bool noDot) d_string.append(1,' '); if(d_nodot) { - if(val.isRoot()) - d_string+="."; - else - d_string+=val.toStringNoDot(); + d_string+=val.toStringRootDot(); } else {