git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] http.c: use 'git_config_string' to get 'curl_http_proxy'

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Dec 7, 2008, 00:45 UTC
Message-ID
<1228610737-8853-1-git-send-email-vmiklos@frugalware.org>
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 http.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/http.c b/http.c
index ed59b79..ee58799 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;
 	}
 }
-- 
1.6.1.rc1.35.gae26e.dirty
Message 1 of 1 in “http.c: use 'git_config_string' to get 'curl_http_proxy'”
  1. http.c: use 'git_config_string' to get 'curl_http_proxy'Miklos Vajna, Dec 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.