Jeff King <peff@xxxxxxxx> writes: > What happens to those poor souls on systems without REG_STARTEND? Do > they get to keep segfaulting? > > I think the solution is to push them into setting NO_REGEX. So looking > at this versus a "regexecn", it seems: > > - this lets people keep using their native regexec if it supports > STARTEND > > - this is a bit more clunky to use at the callsites (though we could > _create_ a portable regexecn wrapper that uses this technique on top > of the native regex library) > > But I much prefer this approach to copying the data just to add a NUL. I first thought "push them to NO_REGEX" to mean "they live with crippled Git that does not do regexp" and went "Huh?", but it merely means "let's avoid platform regex library and use on from the compat/ hierarchy", which would solve the STARTEND portability issue for everybody. Which is very good. The idea to create a thin regexecn() wrapper also sounds like a good idea, too. The changes to the callsites in the demonstration patch does look a bit clunky to me, too.