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

3 messages, 3 authors, 2016-09-08 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-09-08 16:57:53

Jeff King [off-list ref] writes:
Between the two options for regexec_buf(), I think you have convinced me
that REG_STARTEND is better than just using compat/regex everywhere. I
do think the fallback for platforms like musl should be "use
compat/regex" and not doing an expensive copy (which in most cases is
not even necessary).
I agree with you that it would be the best approach to build
regexec_buf() that unconditionally uses REG_STARTEND and tell people
without REG_STARTEND to use compat/regex instead of their platform
regex library.

The description in Makefile may want to be rephrased to clarify.

-# Define NO_REGEX if you have no or inferior regex support in your C library.
+# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
+# feature.

The word "inferior" is not giving any useful information there.

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

From: Johannes Schindelin <hidden>
Date: 2016-09-08 18:23:16

Hi Peff & Junio,

On Thu, 8 Sep 2016, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Between the two options for regexec_buf(), I think you have convinced me
that REG_STARTEND is better than just using compat/regex everywhere. I
do think the fallback for platforms like musl should be "use
compat/regex" and not doing an expensive copy (which in most cases is
not even necessary).
I agree with you that it would be the best approach to build
regexec_buf() that unconditionally uses REG_STARTEND and tell people
without REG_STARTEND to use compat/regex instead of their platform
regex library.

The description in Makefile may want to be rephrased to clarify.

-# Define NO_REGEX if you have no or inferior regex support in your C library.
+# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
+# feature.
Okay, I will make that happen. But first I need to sleep.

Ciao,
Dscho

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

From: Jeff King <hidden>
Date: 2016-09-08 18:48:14

On Thu, Sep 08, 2016 at 09:57:43AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Between the two options for regexec_buf(), I think you have convinced me
that REG_STARTEND is better than just using compat/regex everywhere. I
do think the fallback for platforms like musl should be "use
compat/regex" and not doing an expensive copy (which in most cases is
not even necessary).
I agree with you that it would be the best approach to build
regexec_buf() that unconditionally uses REG_STARTEND and tell people
without REG_STARTEND to use compat/regex instead of their platform
regex library.

The description in Makefile may want to be rephrased to clarify.

-# Define NO_REGEX if you have no or inferior regex support in your C library.
+# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
+# feature.

The word "inferior" is not giving any useful information there.
Yeah, very much agreed (and the "#error" when we lack REG_STARTEND I
mentioned earlier may be a good hint).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help