Subject: Re: [PATCH] Fix in-place editing in crlf_to_git and ident_to_git.

From: Pierre Habouzit <[email-masked]>
Date: Fri, 05 Oct 2007 10:40:54 +0200

On Fri, Oct 05, 2007 at 08:30:45AM +0000, Johannes Schindelin wrote:
> Hi,
> 
> On Fri, 5 Oct 2007, Pierre Habouzit wrote:
> 
> > When crlf_to_git or ident_to_git are called "in place", the buffer 
> > already is big enough and should not be resized (as it could make the 
> > buffer address change, hence invalidate the `src' pointers !).
> 
> I wonder why we resize at all if the buffer is big enough to begin with.

  strbuf_grow takes care of that itself but indeed you make me see that
my patch is wrong. if buf->len > len then len - buf->len is err a bit
big.

  I'll roll better ones.

-- 
·O·  Pierre Habouzit
··O                                                [email-masked]
OOO                                                http://www.madism.org