]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Remove unnecessary trims from ignore list file parsing
authorEnsar Sarajčić <dev@ensarsarajcic.com>
Thu, 6 Jun 2024 06:58:12 +0000 (08:58 +0200)
committerEnsar Sarajčić <dev@ensarsarajcic.com>
Thu, 6 Jun 2024 06:58:12 +0000 (08:58 +0200)
pdns/recursordist/rec-main.cc

index e1f956be824d793f0ca5470be1a2403d61f13109..6781faff1b02ab2ff990207642d8f5adf1829ba7 100644 (file)
@@ -877,8 +877,6 @@ static void parseIgnorelistFile(const std::string& fname, SuffixMatchNode& match
   }
 
   while (getline(ignorelistFileStream, line)) {
-    boost::trim_right(line);
-
     // strip everything after a #
     string::size_type pos = line.find('#');
     if (pos != string::npos) {
@@ -888,14 +886,7 @@ static void parseIgnorelistFile(const std::string& fname, SuffixMatchNode& match
       }
     }
 
-    // strip trailing spaces
-    boost::trim_right(line);
-
-    // strip leading spaces
-    pos = line.find_first_not_of(" \t\r\n");
-    if (pos != string::npos) {
-      line = line.substr(pos);
-    }
+    boost::trim(line);
 
     matchNode.add(DNSName(line));
   }