{"thread":{"id":"13175","subject":"[PATCH] http.c: use 'git_config_string' on configuration options.","startedAt":"2008-04-18T13:17:30Z","lastAt":"2008-04-19T05:16:55Z","messageCount":2,"participants":["Tordek","Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"74730","messageId":"48089F6A.3040102@tordek.com.ar","threadId":"13175","inReplyTo":null,"subject":"[PATCH] http.c: use 'git_config_string' on configuration options.","fromName":"Tordek","fromEmail":"kedrot@gmail.com","sentAt":"2008-04-18T13:17:30Z","receivedAt":"2008-04-18T13:17:30Z","isPatch":true,"sender":{"key":"kedrot@gmail.com","avatar":"https://gravatar.com/avatar/bebae16b32978df6b3e930ec82f6b7e72f5f6883cc6b26419929e0356e9f26a7?d=mp&s=160"},"body":"Signed-off-by: Guillermo O. Freschi <tordek@tordek.com.ar>\n---\n http.c |   35 ++++++++++-------------------------\n 1 files changed, 10 insertions(+), 25 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 256a5f1..cadc1bf 100644\n--- a/http.c\n+++ b/http.c\n@@ -100,39 +100,27 @@ static int http_options(const char *var, const\nchar *value)\n        }\n\n        if (!strcmp(\"http.sslcert\", var)) {\n-               if (ssl_cert == NULL) {\n-                       if (!value)\n-                               return config_error_nonbool(var);\n-                       ssl_cert = xstrdup(value);\n-               }\n+               if (ssl_cert == NULL)\n+                       return git_config_string(&ssl_cert, var, value);\n                return 0;\n        }\n #if LIBCURL_VERSION_NUM >= 0x070902\n        if (!strcmp(\"http.sslkey\", var)) {\n-               if (ssl_key == NULL) {\n-                       if (!value)\n-                               return config_error_nonbool(var);\n-                       ssl_key = xstrdup(value);\n-               }\n+               if (ssl_key == NULL)\n+                       return git_config_string(&ssl_key, var, value);\n                return 0;\n        }\n #endif\n #if LIBCURL_VERSION_NUM >= 0x070908\n        if (!strcmp(\"http.sslcapath\", var)) {\n-               if (ssl_capath == NULL) {\n-                       if (!value)\n-                               return config_error_nonbool(var);\n-                       ssl_capath = xstrdup(value);\n-               }\n+               if (ssl_capath == NULL)\n+                       return git_config_string(&ssl_capath, var, value);\n                return 0;\n        }\n #endif\n        if (!strcmp(\"http.sslcainfo\", var)) {\n-               if (ssl_cainfo == NULL) {\n-                       if (!value)\n-                               return config_error_nonbool(var);\n-                       ssl_cainfo = xstrdup(value);\n-               }\n+               if (ssl_cainfo == NULL)\n+                       return git_config_string(&ssl_cainfo, var, value);\n                return 0;\n        }\n\n@@ -160,11 +148,8 @@ static int http_options(const char *var, const char\n*value)\n                return 0;\n        }\n        if (!strcmp(\"http.proxy\", var)) {\n-               if (curl_http_proxy == NULL) {\n-                       if (!value)\n-                               return config_error_nonbool(var);\n-                       curl_http_proxy = xstrdup(value);\n-               }\n+               if (curl_http_proxy == NULL)\n+                       return git_config_string(&curl_http_proxy, var,\nvalue);\n                return 0;\n        }\n\n--\n1.5.2.2\n"},{"id":"74737","messageId":"200804190716.55490.chriscool@tuxfamily.org","threadId":"13175","inReplyTo":"48089F6A.3040102@tordek.com.ar","subject":"Re: [PATCH] http.c: use 'git_config_string' on configuration options.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-04-19T05:16:55Z","receivedAt":"2008-04-19T05:16:55Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Le vendredi 18 avril 2008, Tordek a écrit :\n> Signed-off-by: Guillermo O. Freschi <tordek@tordek.com.ar>\n> ---\n>  http.c |   35 ++++++++++-------------------------\n>  1 files changed, 10 insertions(+), 25 deletions(-)\n>\n> diff --git a/http.c b/http.c\n> index 256a5f1..cadc1bf 100644\n> --- a/http.c\n> +++ b/http.c\n> @@ -100,39 +100,27 @@ static int http_options(const char *var, const\n> char *value)\n>         }\n>\n>         if (!strcmp(\"http.sslcert\", var)) {\n> -               if (ssl_cert == NULL) {\n> -                       if (!value)\n> -                               return config_error_nonbool(var);\n> -                       ssl_cert = xstrdup(value);\n> -               }\n> +               if (ssl_cert == NULL)\n> +                       return git_config_string(&ssl_cert, var, value);\n>                 return 0;\n>         }\n\nDid you check that there is no compile warnings resulting from this ?\nDid you read the last sentences of http://git.or.cz/gitwiki/Janitor ?\n\nBy the way it seems that your patch has spaces instead of tabs everywhere.\n\nThanks,\nChristian.\n"}]}