From 8b63f61f34aa72da6ed38bd5be38d92b584c0b83 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Sun, 4 Jun 2017 13:12:13 +0200 Subject: [PATCH] add makeUsRelative() to DNSName class --- pdns/dnsname.hh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; -- 2.47.2