Re: [PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-09 Thread Junio C Hamano
Johannes Schindelin writes: >> Also I agree with Peff that a test with an embedded NUL would be a >> good thing. > > This is something I will leave to somebody else, as it was not my > intention to fix this and I *really* have more pressing things to do right > now... Sorry! As I said a few minu

Re: [PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-09 Thread Johannes Schindelin
Hi Peff, On Fri, 9 Sep 2016, Jeff King wrote: > On Fri, Sep 09, 2016 at 11:52:50AM +0200, Johannes Schindelin wrote: > > > > Also I agree with Peff that a test with an embedded NUL would be a > > > good thing. > > > > This is something I will leave to somebody else, as it was not my > > intenti

Re: [PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-09 Thread Jeff King
On Fri, Sep 09, 2016 at 11:52:50AM +0200, Johannes Schindelin wrote: > > Also I agree with Peff that a test with an embedded NUL would be a > > good thing. > > This is something I will leave to somebody else, as it was not my > intention to fix this and I *really* have more pressing things to do

Re: [PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-09 Thread Johannes Schindelin
Hi Junio, On Thu, 8 Sep 2016, Junio C Hamano wrote: > Please give these three patches a common prefix, e.g. > > regex: -G feeds a non NUL-terminated string to regexec() and > fails > regex: add regexec_buf() that can work on a non NUL-terminated string > regex: use regexec_b

Re: [PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-08 Thread Junio C Hamano
Johannes Schindelin writes: > @@ -33,11 +32,8 @@ static void diffgrep_consume(void *priv, char *line, > unsigned long len) >* caller early. >*/ > return; > - /* Yuck -- line ought to be "const char *"! */ > - hold = line[len]; > - line[le

[PATCH v3 3/3] Use the newly-introduced regexec_buf() function

2016-09-08 Thread Johannes Schindelin
The new regexec_buf() function operates on buffers with an explicitly specified length, rather than NUL-terminated strings. We need to use this function whenever the buffer we want to pass to regexec() may have been mmap()ed (and is hence not NUL-terminated). Note: the original motivation for thi