diff options
-rw-r--r-- | gdb/testsuite/gdb.base/readline.exp | 10 | ||||
-rw-r--r-- | readline/readline/callback.c | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp index 4d77033..caf3b4a 100644 --- a/gdb/testsuite/gdb.base/readline.exp +++ b/gdb/testsuite/gdb.base/readline.exp @@ -183,6 +183,16 @@ save_vars { env(TERM) } { } } + # Use the up arrow to select a previous command. Check that + # no unexpected output is added between the previously + # selected command, and the output of that command. + gdb_test "print 123" "\\\$\[0-9\]* = 123" + gdb_test_multiple "\033\[A" "use up arrow" { + -re -wrap "print 123\r\n\\\$\[0-9\]* = 123" { + pass $gdb_test_name + } + } + # Now repeat the first test with a history file that fills the entire # history list. diff --git a/readline/readline/callback.c b/readline/readline/callback.c index 58b84d2..93f23d9 100644 --- a/readline/readline/callback.c +++ b/readline/readline/callback.c @@ -271,8 +271,11 @@ rl_callback_read_char (void) } /* Make sure application hooks can see whether we saw EOF. */ - if (rl_eof_found = eof) - RL_SETSTATE(RL_STATE_EOF); + if (eof > 0) + { + rl_eof_found = eof; + RL_SETSTATE(RL_STATE_EOF); + } if (rl_done) { |