ruby-changes:52900
From: usa <ko1@a...>
Date: Wed, 17 Oct 2018 17:27:46 +0900 (JST)
Subject: [ruby-changes:52900] usa:r65113 (ruby_2_4): merge revision(s) 64900: [Backport #15190]
usa 2018-10-17 17:27:39 +0900 (Wed, 17 Oct 2018) New Revision: 65113 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65113 Log: merge revision(s) 64900: [Backport #15190] Just a shebang is valid code [ruby-core:89240] [Bug #15190] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/ruby.c branches/ruby_2_4/test/ruby/test_rubyoptions.rb branches/ruby_2_4/version.h Index: ruby_2_4/test/ruby/test_rubyoptions.rb =================================================================== --- ruby_2_4/test/ruby/test_rubyoptions.rb (revision 65112) +++ ruby_2_4/test/ruby/test_rubyoptions.rb (revision 65113) @@ -337,6 +337,9 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_rubyoptions.rb#L337 %w[4], [], bug4118) assert_in_out_err(%w[-x], "#!/bin/sh\n""#!shebang\n""#!ruby\n""puts __LINE__\n", %w[4], [], bug4118) + + assert_ruby_status(%w[], "#!") + assert_in_out_err(%w[-c], "#!", ["Syntax OK"]) end def test_sflag Index: ruby_2_4/ruby.c =================================================================== --- ruby_2_4/ruby.c (revision 65112) +++ ruby_2_4/ruby.c (revision 65113) @@ -1798,11 +1798,7 @@ load_file_internal(VALUE argp_v) https://github.com/ruby/ruby/blob/trunk/ruby_2_4/ruby.c#L1798 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_4/version.h =================================================================== --- ruby_2_4/version.h (revision 65112) +++ ruby_2_4/version.h (revision 65113) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-10-17" -#define RUBY_PATCHLEVEL 327 +#define RUBY_PATCHLEVEL 328 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 65112) +++ ruby_2_4 (revision 65113) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r64900 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/