mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
merge revision(s) 64900: [Backport #15190]
Just a shebang is valid code [ruby-core:89240] [Bug #15190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@64980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b014387f68
commit
98eb63a896
3 changed files with 5 additions and 6 deletions
6
ruby.c
6
ruby.c
|
@ -1836,11 +1836,7 @@ load_file_internal(VALUE argp_v)
|
|||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue