diff options
author | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:59:35 -0600 |
---|---|---|
committer | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:59:35 -0600 |
commit | 4a895d111d1b13ddb624a8d055d217e695361447 (patch) | |
tree | 03c8d4640a38d58fbdc5c8ef5458a2613f55e3fb /SOURCES/readline-4.3-input.dif | |
parent | f5afed3fb60ea2a362cfd696b9edf259ca33e1da (diff) | |
download | rpmbuild-sles11.2-bash.tar.gz rpmbuild-sles11.2-bash.tar.xz rpmbuild-sles11.2-bash.zip |
sles 11.2 bash, in wholesles11.2-bash
Diffstat (limited to 'SOURCES/readline-4.3-input.dif')
-rw-r--r-- | SOURCES/readline-4.3-input.dif | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/SOURCES/readline-4.3-input.dif b/SOURCES/readline-4.3-input.dif new file mode 100644 index 0000000..5abe76e --- /dev/null +++ b/SOURCES/readline-4.3-input.dif @@ -0,0 +1,50 @@ +Index: lib/readline/input.c +=================================================================== +--- lib/readline/input.c.orig ++++ lib/readline/input.c +@@ -459,6 +459,8 @@ rl_read_key () + return (c); + } + ++extern int _rl_read_zero_char_from_tty; ++ + int + rl_getc (stream) + FILE *stream; +@@ -482,7 +484,10 @@ rl_getc (stream) + /* If zero characters are returned, then the file that we are + reading from is empty! Return EOF in that case. */ + if (result == 0) +- return (EOF); ++ { ++ _rl_read_zero_char_from_tty = 1; ++ return (EOF); ++ } + + #if defined (__BEOS__) + if (errno == EINTR) +Index: lib/readline/readline.c +=================================================================== +--- lib/readline/readline.c.orig ++++ lib/readline/readline.c +@@ -469,6 +469,9 @@ _rl_internal_char_cleanup () + _rl_erase_entire_line (); + } + ++/* Catch EOF from tty, do not return command line */ ++int _rl_read_zero_char_from_tty = 0; ++ + STATIC_CALLBACK int + #if defined (READLINE_CALLBACKS) + readline_internal_char () +@@ -513,6 +516,10 @@ readline_internal_charloop () + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_READCMD); + ++ /* Return here if terminal is closed */ ++ if (c == EOF && _rl_read_zero_char_from_tty) ++ return (rl_done = 1); ++ + /* look at input.c:rl_getc() for the circumstances under which this will + be returned; punt immediately on read error without converting it to + a newline. */ |