ruby-changes:50097
From: nobu <ko1@a...>
Date: Mon, 5 Feb 2018 11:02:27 +0900 (JST)
Subject: [ruby-changes:50097] nobu:r62215 (trunk): transform_mjit_header.rb: read/write in binmode
nobu 2018-02-05 11:02:23 +0900 (Mon, 05 Feb 2018) New Revision: 62215 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62215 Log: transform_mjit_header.rb: read/write in binmode * tool/transform_mjit_header.rb: read and write as ASCII-8BIT to make single-byte-optimizable always. Modified files: trunk/tool/transform_mjit_header.rb Index: tool/transform_mjit_header.rb =================================================================== --- tool/transform_mjit_header.rb (revision 62214) +++ tool/transform_mjit_header.rb (revision 62215) @@ -104,7 +104,7 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L104 def self.write(code, out) FileUtils.mkdir_p(File.dirname(out)) - File.write("#{out}.new", code) + File.binwrite("#{out}.new", code) FileUtils.mv("#{out}.new", out) end @@ -119,7 +119,7 @@ if ARGV.size != 3 https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L119 end cc = ARGV[0] -code = File.read(ARGV[1]) # Current version of the header file. +code = File.binread(ARGV[1]) # Current version of the header file. outfile = ARGV[2] if cc =~ /\Acl(\z| |\.exe)/ cflags = '-DMJIT_HEADER -Zs' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/