Re: [PATCH] userdiff: support regexec(3) with multi-byte support
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Apr 7, 2023, 10:56 UTC
- Message-ID
- <a548ca26-2766-1a95-4928-c22063d5d890@kdbg.org>
- In-Reply-To
- <39eb2a9f-83e0-449e-1157-152c43d49b48@web.de>
Am 07.04.23 um 09:49 schrieb René Scharfe:
Show 9 quoted lines
> Am 07.04.23 um 00:35 schrieb Johannes Sixt: >> This is not equivalent. The original treated a sequence of non-ASCII >> characters as a word. The new version treats each individual non-space >> character (both ASCII and non-ASCII) as a word. > > I assume you mean "The original treated [a single non-space as well as] > a sequence of non-ASCII characters [making up a single multi-byte > character] as a word.". That works as intended by 664d44ee7f (userdiff: > simplify word-diff safeguard, 2011-01-11).
I misread the original RE. I thought it would lump multiple multi-byte characters together into one word, but it does not; sorry for that. It looks like your suggested replacement is behaviorally identical to the original after all, except perhaps for this one:
> The new one doesn't match multi-byte whitespace anymore.
but I did not find a reference that confirms it. I don't think we need to bend over backwards to keep this compatibility, though.
-- Hannes