From aa8d393d8a69d1a5780d338692f75e2dd821c5b0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 4 Jun 2019 09:24:17 +0900 Subject: EOF by 2 ^D on a TTY Terminate the input from a TTY by 2 ^D at the middle of line, like as many programs, `cat`, `perl` and so on, do. By the first ^D, the line will be sent without a newline, and then EOF will be send by the next ^D. --- ruby.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 944b6c7f5c..e016197e05 100644 --- a/ruby.c +++ b/ruby.c @@ -2011,7 +2011,7 @@ load_file_internal(VALUE argp_v) else if (!NIL_P(c)) { rb_io_ungetbyte(f, c); } - else { + if (NIL_P(c)) { argp->f = f = Qnil; } if (!(opt->dump & ~DUMP_BIT(version_v))) { -- cgit v1.2.3