On Wed, Oct 23, 2013 at 3:04 PM, Duy Nguyen <pclo...@gmail.com> wrote:
> On Wed, Oct 23, 2013 at 7:58 PM, Antoine Pelisse <apeli...@gmail.com> wrote:
>>> diff --git a/entry.c b/entry.c
>>> index acc892f..d955af5 100644
>>> --- a/entry.c
>>> +++ b/entry.c
>>> @@ -237,16 +237,18 @@ static int check_path(const char *path, int len, 
>>> struct stat *st, int skiplen)
>>>  int checkout_entry(struct cache_entry *ce,
>>>                    const struct checkout *state, char *topath)
>>>  {
>>> -       static char path[PATH_MAX + 1];
>>> +       static struct strbuf path_buf = STRBUF_INIT;
>>> +       char *path;
>>>         struct stat st;
>>> -       int len = state->base_dir_len;
>>> +       int len;
>>>
>>>         if (topath)
>>>                 return write_entry(ce, topath, state, 1);
>>>
>>> -       memcpy(path, state->base_dir, len);
>>> -       strcpy(path + len, ce->name);
>>> -       len += ce_namelen(ce);
>>> +       strbuf_reset(&path_buf);
>>
>> I think this is not required
>
> If you mean strbuf_reset, I think it is. path_buf is still static (I
> don't want to remove that because it'll add a lot more strbuf_release)
> so we can't be sure what it contains from the second checkout_entry()
> call.

Of course, I forgot about the static,
Thanks :-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to