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