summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rwxr-xr-xext/extmk.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index eda487c30e..1ca5efd52c 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -222,14 +222,14 @@ def extmake(target)
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
ok = yield(ok) if block_given?
if ok
- open(makefile, "r+") do |f|
- s = f.read.sub!(/^(static:)\s.*/, '\1 all')
+ open(makefile, "r+b") do |f|
+ s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break
f.rewind
f.print(s)
f.truncate(f.pos)
end
else
- open(makefile, "w") do |f|
+ open(makefile, "wb") do |f|
f.puts "# " + DUMMY_SIGNATURE
f.print(*dummy_makefile(CONFIG["srcdir"]))
end