On 12/17/14, 8:34 AM, Jiri Kukacka wrote:

> I understand that this is due to handling EOF from closed TTY as \n, thus
> executing the command, and this is standard behavior of readline, but I
> think the problem is quite serious, so I have to fix it, and I hope that
> you would like this to have fixed as well.
> 
> So, my current suggested fix is attached bellow (created for Bash 4.2),
> thanks for any comments to it.

I would be interested in knowing what happens when the existing code is
executed.  In bash-4.2/readline-6.2, rl_getc returns READERR if read(2)
returns -1/errno!=EINTR and readline returns immediately without adding
a newline.  It may be that bash executes a command that does not end in
a newline, but in this case it doesn't seem like the code you modified
should be executed.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to