aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun Jackman2013-09-17 11:44:27 -0700
committerJack Nagel2013-09-17 13:58:34 -0500
commit70489b72c36dbc88673e1ae3000a9b1edfb71fb0 (patch)
tree5e5a4f4fd68eea859683552805d9fe793e3cf31b
parent95e75c182b75d1326aad232a1f96f4af87a67264 (diff)
downloadhomebrew-70489b72c36dbc88673e1ae3000a9b1edfb71fb0.tar.bz2
inreplace: Open the file as binary
Closes #22628. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Homebrew/utils/inreplace.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb
index accb7d83c..b4bc05468 100644
--- a/Library/Homebrew/utils/inreplace.rb
+++ b/Library/Homebrew/utils/inreplace.rb
@@ -2,7 +2,7 @@ module Utils
module Inreplace
def inreplace paths, before=nil, after=nil
Array(paths).each do |path|
- f = File.open(path, 'r')
+ f = File.open(path, 'rb')
s = f.read
if before.nil? && after.nil?
@@ -17,7 +17,7 @@ module Utils
end
end
- f.reopen(path, 'w').write(s)
+ f.reopen(path, 'wb').write(s)
f.close
end
end