From: Miklos Vajna Date: Sun, 7 Dec 2008 00:45:37 +0000 (+0100) Subject: http.c: use 'git_config_string' to get 'curl_http_proxy' X-Git-Tag: v1.6.0.5~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e4a80ecf40c9651741def7c4f0b2ca56b42af1a8;p=git.git http.c: use 'git_config_string' to get 'curl_http_proxy' Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- diff --git a/http.c b/http.c index a97fdf511..c18e30abe 100644 --- a/http.c +++ b/http.c @@ -24,7 +24,7 @@ static const char *ssl_cainfo = NULL; static long curl_low_speed_limit = -1; static long curl_low_speed_time = -1; static int curl_ftp_no_epsv = 0; -static char *curl_http_proxy = NULL; +static const char *curl_http_proxy = NULL; static struct curl_slist *pragma_header; @@ -149,11 +149,8 @@ static int http_options(const char *var, const char *value, void *cb) return 0; } if (!strcmp("http.proxy", var)) { - if (curl_http_proxy == NULL) { - if (!value) - return config_error_nonbool(var); - curl_http_proxy = xstrdup(value); - } + if (curl_http_proxy == NULL) + return git_config_string(&curl_http_proxy, var, value); return 0; } @@ -309,7 +306,7 @@ void http_cleanup(void) pragma_header = NULL; if (curl_http_proxy) { - free(curl_http_proxy); + free((void *)curl_http_proxy); curl_http_proxy = NULL; } }