Re: [PATCH v2] Allow HTTP user agent string to be modified.
- From
Spencer E. Olson <olsonse@umich.edu>
- Date
- Aug 7, 2010, 17:29 UTC
- Message-ID
- <1281202184.4815.1.camel@compaq.olson.home>
- In-Reply-To
- <AANLkTinyohKaACbheGR2Q=-K5sWwv+y1u1-3b2WPzxVh@mail.gmail.com>
I would have no problem doing that. I was just trying to match the style already present in http.c. All the other pointer tests in that function/file are done the same.
On Sat, 2010-08-07 at 08:34 +0000, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> On Sat, Aug 7, 2010 at 03:34, Spencer E. Olson <olsonse@umich.edu> wrote: > > > - curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT); > > + if (user_agent != NULL) > > + curl_easy_setopt(result, CURLOPT_USERAGENT, user_agent); > > + else > > + curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT); > > Can't you just skip the != NULL?: > > if (user_agent) > curl_easy_setopt(result, CURLOPT_USERAGENT, user_agent); > else > curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT); > >