Re: PATCH: fix crash involving backslash quoting in set_comp_sep()

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAHYJk3R-cJ6Hg_RgxnZ+XMhoi683E3X+3WvSfFZxSFhEkaZLow@mail.gmail.com>
On Sat, May 30, 2026 at 7:51 AM Mikael Magnusson <[email protected]> wrote:
>
> Originally reported in 46120, with minimal recipe in 46156.
>
> The QT_BACKSLASH case just removed backslashes without tracking how many, but we
> need to know that for later, so do it more like how QT_DOUBLE does it.
>
> Without the swe += bq, alias a=\\\[<tab> becomes a=\\\[\[ which isn't
> right.

I'm retracting this patch for now, the more I stared at this function,
the more I realize it can never work with complete_in_word the way
it's written. It tries to track the total number of removed quote
marks (whether it's " or ' or \) and then adjusts things based on
that, but it doesn't at all account for where these removed marks are
in relation to either the cursor or the start/end of the current word
(It's fairly trivial to come up with other examples that crash with
this patch too). I fiddled a bit with reworking it but it's obviously
a little tricky, don't hold your breath.

-- 
Mikael Magnusson
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.