summaryrefslogtreecommitdiff
path: root/builtin/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-16 17:07:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-16 17:07:15 (GMT)
commitb4516df9b88989a175f88aa514a187831631f9f8 (patch)
tree6c699d6b39248593193b1cd9ad5d0430ab4a64ee /builtin/config.c
parent09e13ad5b0f0689418a723289dca7b3c72d538c4 (diff)
parent88d5a6f6cd1b63e1637027322cdfdbeefe38c3ed (diff)
downloadgit-b4516df9b88989a175f88aa514a187831631f9f8.zip
git-b4516df9b88989a175f88aa514a187831631f9f8.tar.gz
git-b4516df9b88989a175f88aa514a187831631f9f8.tar.bz2
Merge branch 'jk/daemon-tolower'
* jk/daemon-tolower: daemon/config: factor out duplicate xstrdup_tolower
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 5677c94..fcd8474 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -395,19 +395,6 @@ static int urlmatch_collect_fn(const char *var, const char *value, void *cb)
return 0;
}
-static char *dup_downcase(const char *string)
-{
- char *result;
- size_t len, i;
-
- len = strlen(string);
- result = xmalloc(len + 1);
- for (i = 0; i < len; i++)
- result[i] = tolower(string[i]);
- result[i] = '\0';
- return result;
-}
-
static int get_urlmatch(const char *var, const char *url)
{
char *section_tail;
@@ -422,7 +409,7 @@ static int get_urlmatch(const char *var, const char *url)
if (!url_normalize(url, &config.url))
die("%s", config.url.err);
- config.section = dup_downcase(var);
+ config.section = xstrdup_tolower(var);
section_tail = strchr(config.section, '.');
if (section_tail) {
*section_tail = '\0';