no need to double strip this line

no need to double strip this line

From d7b0f0069cda2e2a4cf24d1e8fe1e1945894334d Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Fri, 23 Nov 2018 14:48:02 +1100
Subject: [PATCH] no need to double strip this line


diff --git a/script/cache_critical_dns b/script/cache_critical_dns
index 99684af..a3e893e 100755
--- a/script/cache_critical_dns
+++ b/script/cache_critical_dns
@@ -30,7 +30,7 @@ def swap_address(hosts, name, ips)
   hosts.split("\n").each do |line|
     line.strip!
     if line[0] != '#'
-      _, hostname = line.strip.split(/\s+/)
+      _, hostname = line.split(/\s+/)
       next if hostname == name
     end
     new_file << line

GitHub

1 Like