From: Tordek <kedrot@gmail.com>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH (try 3)] http.c: 'use_git_config_string' on configuration options.
Date: Sat, 19 Apr 2008 19:39:21 -0300 [thread overview]
Message-ID: <480A7499.1040705@gmail.com> (raw)
Signed-off-by: Guillermo O. Freschi <tordek@tordek.com.ar>
---
My apologies, I had made a mistake on the previous attempt.
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
next reply other threads:[~2008-04-19 22:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-19 22:39 Tordek [this message]
2008-04-20 3:30 ` [PATCH (try 3)] http.c: 'use_git_config_string' on configuration options Junio C Hamano
2008-04-20 13:54 ` Stephan Beyer
2008-04-20 4:06 ` Christian Couder
[not found] ` <b362b0fe0804192335v6486fe0cs5e5c0bf1609e3524@mail.gmail.com>
[not found] ` <b362b0fe0804192354x2e91e45asca5dc74208e7be68@mail.gmail.com>
2008-04-20 7:10 ` Tordek
2008-04-20 16:26 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=480A7499.1040705@gmail.com \
--to=kedrot@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).