aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ruby.c b/ruby.c
index a5464e1a0a..a72a5dfb32 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1913,11 +1913,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) {