]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Update pdns/zoneparser-tng.cc 15854/head
authorJamie (Bear) Murphy <1613241+ITJamie@users.noreply.github.com>
Wed, 16 Jul 2025 14:41:27 +0000 (15:41 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Jul 2025 14:41:27 +0000 (15:41 +0100)
Co-authored-by: Miod Vallat <miod.vallat@powerdns.com>
Signed-off-by: Jamie (Bear) Murphy <1613241+ITJamie@users.noreply.github.com>
pdns/zoneparser-tng.cc

index c15e03ec649a98378efcde0139325e7f4c04154f..e004e3f21146ac64af35a634ba7e0320e7088e13 100644 (file)
@@ -369,8 +369,7 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment)
     else if(pdns_iequals(command,"$INCLUDE") && d_parts.size() > 1 && d_fromfile) {
       string fname=unquotify(makeString(d_line, d_parts[1]));
       // Find the first semicolon and remove everything after it, including the semicolon
-      size_t semicolon_pos = fname.find(';');
-      if (semicolon_pos != string::npos) {
+      if (auto semicolon_pos = fname.find(';'); semicolon_pos != string::npos) {
         fname.resize(semicolon_pos);
       }
       if (!fname.empty() && fname[0] != '/' && !d_reldir.empty()) {