Re: [PATCH 2/3] diff_populate_filespec: NUL-terminate buffers

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

 



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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]