bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] parser handling of \^A


From: Robert Elz
Subject: Re: [PATCH] parser handling of \^A
Date: Fri, 13 Oct 2023 12:55:18 +0700

    Date:        Thu, 12 Oct 2023 21:36:48 -0700
    From:        Grisha Levit <grishalevit@gmail.com>
    Message-ID:  
<CAMu=BrpAEw1Dv4h6f2GZQ7hWad5gB2YK2NcF8qrjAOZkiRqMfQ@mail.gmail.com>

  | There are some issues with parser output when the input has an unquoted
  | backslash followed by a raw ^A character:

The NetBSD shell (and probably other ash derived shells) used to
have issues with that as well.

The solution (for us) was to be ruthless about inserting the
CTLESC before any character that is to be treated literally,
but which might, in any context at all, be treated as magic,
(which includes literal examples of the byte used to mean CTLESC
of course) and never be tempted to "optimise" on the basis of
"the CTLESC is not needed here because...." however reasonable
the reason might sound.

It does mean always making sure that all (unescaped) CTLESC
chars are removed (or properly ignored) in every context where
a string is needed, it can never be skipped - but once all
that gets fixed, all these kinds of problems just vanish.

kre



reply via email to

[Prev in Thread] Current Thread [Next in Thread]