Skip to content
Snippets Groups Projects
Commit 91e6c993 authored by Shaun Jackman's avatar Shaun Jackman Committed by Jack Nagel
Browse files

inreplace: Open the file as binary


Closes Homebrew/homebrew#22628.

Signed-off-by: default avatarJack Nagel <jacknagel@gmail.com>
parent 907ac796
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment