Re: [PATCH] http-push: refactor request url creation
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 26, 2009, 10:41 UTC
- Message-ID
- <alpine.DEB.1.00.0901261141070.14855@racer>
- In-Reply-To
- <be6fef0d0901251752p5b34c053pb24dce8a35b06fce@mail.gmail.com>
Hi,
On Mon, 26 Jan 2009, Ray Chuan wrote:
Show 20 quoted lines
> On Mon, Jan 26, 2009 at 4:35 AM, Junio C Hamano <gitster@pobox.com> wrote: > >> @@ -304,17 +312,7 @@ static void start_fetch_loose(struct > >> transfer_request *request) > >> > >> git_SHA1_Init(&request->c); > >> > >> - url = xmalloc(strlen(remote->url) + 50); > >> ... > >> - strcpy(request->url, url); > >> + request->url = get_remote_object_url(remote->url, hex, 0); > >> ... > >> - curl_easy_setopt(slot->curl, CURLOPT_URL, url); > >> + curl_easy_setopt(slot->curl, CURLOPT_URL, request->url); > > > > The original code gave a separate "url" to setop() but this gives the same > > string. Does curl_easy_setop() copies the given string away? IOW is this > > change safe? > > > > curl strdup's it, so this is safe.
I might have mentioned that things like this _need_ to go into the commit message.
Ciao, Dscho