From: Johannes Schindelin Date: Tue, 10 Mar 2009 11:07:56 GMT Subject: Re: [RFH Patch 2/2] http_init(): Fix config file parsing Message-ID: In-Reply-To: <76718490903092005n66bca743t67eb7f0ff830d9d7@mail.gmail.com> Hi, On Mon, 9 Mar 2009, Jay Soffian wrote: > On Mon, Mar 9, 2009 at 10:19 PM, Junio C Hamano wrote: > > > @@ -241,14 +221,18 @@ void http_init(struct remote *remote) > >        if (getenv("GIT_SSL_NO_VERIFY")) > >                curl_ssl_verify = 0; > > > > -       ssl_cert = getenv("GIT_SSL_CERT"); > > +       if (getenv("GIT_SSL_CERT")) > > +               ssl_cert = getenv("GIT_SSL_CERT"); > >  #if LIBCURL_VERSION_NUM >= 0x070902 > > -       ssl_key = getenv("GIT_SSL_KEY"); > > +       if (getenv("GIT_SSL_KEY")) > > +               ssl_key = getenv("GIT_SSL_KEY"); > >  #endif > >  #if LIBCURL_VERSION_NUM >= 0x070908 > > -       ssl_capath = getenv("GIT_SSL_CAPATH"); > > +       if (getenv("GIT_SSL_CAPATH")) > > +               ssl_capath = getenv("GIT_SSL_CAPATH"); > >  #endif > > -       ssl_cainfo = getenv("GIT_SSL_CAINFO"); > > +       if (getenv("GIT_SSL_CAINFO")) > > +               ssl_cainfo = getenv("GIT_SSL_CAINFO"); > > Would these be a little cleaner with a temporary variable. e.g. > > char *value; > > if ((value = getenv("GIT_SSL_CERT"))) > ssl_cert = value; Nah, you should go the full nine yards right away: static void set_from_env(const char **variable, const char *name) { const char *value = getenv(name); if (value) *variable = value; } Ciao, Dscho