diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 287058021b..4fa2fbe7c2 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -10,8 +10,7 @@ module Utils yield s else after = after.to_s if Symbol === after - sub = s.gsub!(before, after) - if sub.nil? + unless s.gsub!(before, after) message = <<-EOS.undent inreplace in '#{path}' failed Expected replacement of '#{before}' with '#{after}'