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

Re: [PATCH (try 3)] http.c: 'use_git_config_string' on configuration options.

From
Tordek <kedrot@gmail.com>
Date
Apr 20, 2008, 07:10 UTC
Message-ID
<b362b0fe0804200010t465b49absba03102cb1364021@mail.gmail.com>
In-Reply-To
<b362b0fe0804192354x2e91e45asca5dc74208e7be68@mail.gmail.com>
Signed-off-by: Guillermo O. Freschi <tordek@tordek.com.ar>
---
Okay, I'm skipping the middleman this time; Thunderbird mangles patches...
 http.c |   36 ++++++++++++------------------------
 1 files changed, 12 insertions(+), 24 deletions(-)
diff --git a/http.c b/http.c
index 256a5f1..8ae6432 100644
--- a/http.c
+++ b/http.c
@@ -13,14 +13,14 @@ static CURL *curl_default;
 char curl_errorstr[CURL_ERROR_SIZE];

 static int curl_ssl_verify = -1;
-static char *ssl_cert = NULL;
+static const char *ssl_cert = NULL;
 #if LIBCURL_VERSION_NUM >= 0x070902
-static char *ssl_key = NULL;
+static const char *ssl_key = NULL;
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070908
-static char *ssl_capath = NULL;
+static const char *ssl_capath = NULL;
 #endif
-static char *ssl_cainfo = NULL;
+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;
@@ -100,39 +100,27 @@ static int http_options(const char *var, const
char *value)
 	}

 	if (!strcmp("http.sslcert", var)) {
-		if (ssl_cert == NULL) {
-			if (!value)
-				return config_error_nonbool(var);
-			ssl_cert = xstrdup(value);
-		}
+		if (ssl_cert == NULL)
+			return git_config_string(&ssl_cert, var, value);
 		return 0;
 	}
 #if LIBCURL_VERSION_NUM >= 0x070902
 	if (!strcmp("http.sslkey", var)) {
-		if (ssl_key == NULL) {
-			if (!value)
-				return config_error_nonbool(var);
-			ssl_key = xstrdup(value);
-		}
+		if (ssl_key == NULL)
+			return git_config_string(&ssl_key, var, value);
 		return 0;
 	}
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070908
 	if (!strcmp("http.sslcapath", var)) {
-		if (ssl_capath == NULL) {
-			if (!value)
-				return config_error_nonbool(var);
-			ssl_capath = xstrdup(value);
-		}
+		if (ssl_capath == NULL)
+			return git_config_string(&ssl_capath, var, value);
 		return 0;
 	}
 #endif
 	if (!strcmp("http.sslcainfo", var)) {
-		if (ssl_cainfo == NULL) {
-			if (!value)
-				return config_error_nonbool(var);
-			ssl_cainfo = xstrdup(value);
-		}
+		if (ssl_cainfo == NULL)
+			return git_config_string(&ssl_cainfo, var, value);
 		return 0;
 	}
-- 
1.5.2.2
Previous: Junio C Hamano
Message 6 of 6 in “http.c: 'use_git_config_string' on configuration options.”
  1. http.c: 'use_git_config_string' on configuration options.Tordek, Apr 19, 2008
  2. Junio C HamanoApr 20, 2008
  3. Stephan BeyerApr 20, 2008
  4. Christian CouderApr 20, 2008
  5. Junio C HamanoApr 20, 2008
  6. TordekApr 20, 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.