mirror of
https://github.com/ruby/ruby.git
synced 2025-08-16 05:59:00 +02:00
* ruby.c (load_file): avoid SEGV on '#' only input.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b1f086d014
commit
1995213e4b
3 changed files with 7 additions and 2 deletions
1
ruby.c
1
ruby.c
|
@ -794,6 +794,7 @@ load_file(fname, script)
|
|||
c = rb_io_getc(f);
|
||||
if (c == INT2FIX('#')) {
|
||||
line = rb_io_gets(f);
|
||||
if (NIL_P(line)) return;
|
||||
line_start++;
|
||||
|
||||
if (RSTRING(line)->len > 2 && RSTRING(line)->ptr[0] == '!') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue