@matheusbsbs / matheus-bagliano / commits / e4a80ecf40
Fork 0

http.c: use 'git_config_string' to get 'curl_http_proxy'

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Miklos Vajna committed Dec 7, 2008 at 01:45 UTC e4a80ecf40c9651741def7c4f0b2ca56b42af1a8
1 file changed +4 -7
http.c
+4 -7
@@ -24,7 +24,7 @@ static const char *ssl_cainfo = NULL;
24 static long curl_low_speed_limit = -1;
25 static long curl_low_speed_time = -1;
26 static int curl_ftp_no_epsv = 0;
27 -static char *curl_http_proxy = NULL;
27 +static const char *curl_http_proxy = NULL;
28
29 static struct curl_slist *pragma_header;
30
@@ -149,11 +149,8 @@ static int http_options(const char *var, const char *value, void *cb)
149 return 0;
150 }
151 if (!strcmp("http.proxy", var)) {
152 - if (curl_http_proxy == NULL) {
153 - if (!value)
154 - return config_error_nonbool(var);
155 - curl_http_proxy = xstrdup(value);
156 - }
152 + if (curl_http_proxy == NULL)
153 + return git_config_string(&curl_http_proxy, var, value);
154 return 0;
155 }
156
@@ -309,7 +306,7 @@ void http_cleanup(void)
306 pragma_header = NULL;
307
308 if (curl_http_proxy) {
312 - free(curl_http_proxy);
309 + free((void *)curl_http_proxy);
310 curl_http_proxy = NULL;
311 }
312 }