http://lists.gnu.org/archive/html/bug-bash/2014-12/msg00152.html *** ../bash-4.3-patched/lib/readline/readline.c 2014-10-01 13:08:28.000000000 -0400 --- lib/readline/readline.c 2014-12-20 22:37:28.000000000 -0500 *************** *** 580,592 **** } ! /* EOF typed to a non-blank line is a <NL>. If we want to change this, ! to force any existing line to be ignored when read(2) reads EOF, ! for example, this is the place to change. */ if (c == EOF && rl_end) ! c = NEWLINE; /* The character _rl_eof_char typed to blank line, and not as the ! previous character is interpreted as EOF. */ ! if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end) { #if defined (READLINE_CALLBACKS) --- 587,620 ---- } ! /* EOF typed to a non-blank line is ^D the first time, EOF the second ! time in a row. This won't return any partial line read from the tty. ! If we want to change this, to force any existing line to be returned ! when read(2) reads EOF, for example, this is the place to change. */ if (c == EOF && rl_end) ! { ! if (RL_SIG_RECEIVED ()) ! { ! RL_CHECK_SIGNALS (); ! if (rl_signal_event_hook) ! (*rl_signal_event_hook) (); /* XXX */ ! } ! ! /* XXX - reading two consecutive EOFs returns EOF */ ! if (RL_ISSTATE (RL_STATE_TERMPREPPED)) ! { ! if (lastc == _rl_eof_char || lastc == EOF) ! rl_end = 0; ! else ! c = _rl_eof_char; ! } ! else ! c = NEWLINE; ! } /* The character _rl_eof_char typed to blank line, and not as the ! previous character is interpreted as EOF. This doesn't work when ! READLINE_CALLBACKS is defined, so hitting a series of ^Ds will ! erase all the chars on the line and then return EOF. */ ! if (((c == _rl_eof_char && lastc != c) || c == EOF) && rl_end == 0) { #if defined (READLINE_CALLBACKS)