From: Kees Monshouwer Date: Sun, 4 Jun 2017 11:12:13 +0000 (+0200) Subject: add makeUsRelative() to DNSName class X-Git-Tag: rec-4.1.0-alpha1~91^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b63f61f34aa72da6ed38bd5be38d92b584c0b83;p=thirdparty%2Fpdns.git add makeUsRelative() to DNSName class --- diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index c57faf996f..0c32afd1d7 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -83,12 +83,15 @@ public: DNSName makeRelative(const DNSName& zone) const; DNSName makeLowerCase() const { - DNSName ret; - ret.d_storage = d_storage; - for(auto & c : ret.d_storage) { + DNSName ret(*this); + ret.makeUsLowerCase(); + return ret; + } + void makeUsLowerCase() + { + for(auto & c : d_storage) { c=dns_tolower(c); } - return ret; } void makeUsRelative(const DNSName& zone); DNSName labelReverse() const;