URL:
  <https://savannah.gnu.org/bugs/?67045>

                 Summary: bash parsing error, when using readline,
backslashes, and <Ctrl-d>
                   Group: The GNU Bourne-Again SHell
               Submitter: None
               Submitted: Tue 22 Apr 2025 08:41:19 PM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 22 Apr 2025 08:41:19 PM UTC By: Anonymous
When using readline, this happens


$ echo hello\<Return>
> <Ctrl-d>
> world<Return>
hello world
$ <Up arrow for history>
$ echo helloworld


Note, there is no issue when backslash is a word by itself

$ echo hello \
> <Ctrl-d>
hello
[Bash exits here]


After some debugging, I understood, that this happens because of shell_getc,
and eventually yy_readline_get multiple times in the case of a word ending in
\, and because readline can continue working after getting a <Ctrl-D> (read of
0 bytes), I propose putting a flag, and not call readline after having gotten
0 bytes. I am attaching a proposed patch






    _______________________________________________________
File Attachments:


-------------------------------------------------------
Name: readline_eof_fix.patch  Size: 947B
<https://file.savannah.gnu.org/file/readline_eof_fix.patch?file_id=57157>

    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-962f8dd2e65d30409210f66560945e9bbc413549.tar.gz

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67045>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to