aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/inreplace.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/utils/inreplace.rb')
-rw-r--r--Library/Homebrew/utils/inreplace.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb
index 287058021..4fa2fbe7c 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}'