aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index d36eb2543..2c444322b 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -40,13 +40,10 @@ class Keg
(pkgconfig_files | libtool_files | script_files).each do |file|
file.ensure_writable do
- file.open('rb') do |f|
- s = f.read
- s.gsub!(old_cellar, new_cellar)
- s.gsub!(old_prefix, new_prefix)
- f.reopen(file, 'wb')
- f.write(s)
- end
+ s = file.open("rb", &:read)
+ s.gsub!(old_cellar, new_cellar)
+ s.gsub!(old_prefix, new_prefix)
+ file.atomic_write(s)
end
end
end