readline: back-port changes needed to properly detect EOF
authorAndrew Burgess <aburgess@redhat.com>
Mon, 7 Mar 2022 13:49:21 +0000 (13:49 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Fri, 22 Apr 2022 17:46:04 +0000 (18:46 +0100)
commit4fb7bc4b147fd30b781ea2dad533956d0362295a
treecd4da5ab2f797bb9b0defa9242b6cf0a9c7fe386
parentb913bd98ce81a1600463f9a8a30db04d44b64a47
readline: back-port changes needed to properly detect EOF

This commit is a partial back-port of this upstream readline commit:

  commit 002d31aa5f5929eb32d0e0e2e8b8d35d99e59961
  Author: Chet Ramey <chet.ramey@case.edu>
  Date:   Thu Mar 3 11:11:47 2022 -0500

      add rl_eof_found to public API; fix pointer aliasing problems  \
            with history-search-backward; fix a display problem with \
            runs of invisible characters at the end of a physical    \
            screen line

I have only pulled in the parts of this commit that relate to the new
rl_eof_found global, and the RL_STATE_EOF state flag.  These changes
are needed in order to fix PR cli/28833, and are discussed in this
thread to the bug-readline mailing list:

  https://lists.gnu.org/archive/html/bug-readline/2022-02/msg00021.html

The above commit is not yet in any official readline release, but my
hope is that now it has been merged into the readline tree it should
be safe enough to back port this fix to GDB's tree.

At some point in the future we will inevitably want to roll forward
the version of readline that we maintain in the binutils-gdb
repository.  When that day comes the changes in this commit can be
replaced with the latest upstream readline code, as I have not changed
the meaning of this code at all from what is in upstream readline.

This commit alone does not fix the PR cli/28833 issue, for that see
the next commit, which changes GDB itself.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28833
readline/readline/callback.c
readline/readline/doc/rltech.texi
readline/readline/readline.c
readline/readline/readline.h
readline/readline/rlprivate.h
readline/readline/rltty.c