ruby-changes:52768
From: nagachika <ko1@a...>
Date: Tue, 9 Oct 2018 23:25:43 +0900 (JST)
Subject: [ruby-changes:52768] nagachika:r64980 (ruby_2_5): merge revision(s) 64900: [Backport #15190]
nagachika 2018-10-09 23:25:37 +0900 (Tue, 09 Oct 2018) New Revision: 64980 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64980 Log: merge revision(s) 64900: [Backport #15190] Just a shebang is valid code [ruby-core:89240] [Bug #15190] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/ruby.c branches/ruby_2_5/test/ruby/test_rubyoptions.rb branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 64979) +++ ruby_2_5/version.h (revision 64980) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.2" #define RUBY_RELEASE_DATE "2018-10-09" -#define RUBY_PATCHLEVEL 93 +#define RUBY_PATCHLEVEL 94 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_5/ruby.c =================================================================== --- ruby_2_5/ruby.c (revision 64979) +++ ruby_2_5/ruby.c (revision 64980) @@ -1836,11 +1836,7 @@ load_file_internal(VALUE argp_v) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/ruby.c#L1836 c = rb_io_getbyte(f); if (c == INT2FIX('#')) { c = rb_io_getbyte(f); - if (c == INT2FIX('!')) { - line = rb_io_gets(f); - if (NIL_P(line)) - return 0; - + if (c == INT2FIX('!') && !NIL_P(line = rb_io_gets(f))) { RSTRING_GETMEM(line, str, len); warn_cr_in_shebang(str, len); if ((p = strstr(str, ruby_engine)) == 0) { Index: ruby_2_5/test/ruby/test_rubyoptions.rb =================================================================== --- ruby_2_5/test/ruby/test_rubyoptions.rb (revision 64979) +++ ruby_2_5/test/ruby/test_rubyoptions.rb (revision 64980) @@ -344,6 +344,9 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_rubyoptions.rb#L344 %w[4], [], bug4118) assert_ruby_status(%w[], "#! ruby -- /", '[ruby-core:82267] [Bug #13786]') + + assert_ruby_status(%w[], "#!") + assert_in_out_err(%w[-c], "#!", ["Syntax OK"]) end def test_flag_in_shebang Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 64979) +++ ruby_2_5 (revision 64980) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r64900 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/