diff options
| author | Shaun Jackman | 2013-09-17 11:44:27 -0700 |
|---|---|---|
| committer | Jack Nagel | 2013-09-17 13:58:34 -0500 |
| commit | 91e6c993f868a648d57d9666e9855198686003e3 (patch) | |
| tree | a7b967981bfe85ee8d28c5ecd629c621f9fee5ab /Library/Homebrew/utils | |
| parent | 907ac79606537189a0a7c822be1210c4d4801df3 (diff) | |
| download | brew-91e6c993f868a648d57d9666e9855198686003e3.tar.bz2 | |
inreplace: Open the file as binary
Closes Homebrew/homebrew#22628.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/utils')
| -rw-r--r-- | Library/Homebrew/utils/inreplace.rb | 4 |
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 |
