X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=repo-config.c;fp=repo-config.c;h=58b6c5284fa806ddda70e84d3871415ba26c893f;hb=d14f776402d9f7040cc71ff6e3b992b2e019526a;hp=c5ebb7668a2632ef94cc798552ddd3f6f173e4f4;hpb=bdf0ef0824ecca427ec04ac047ffe4aaf73ace5a;p=git.git diff --git a/repo-config.c b/repo-config.c index c5ebb766..58b6c528 100644 --- a/repo-config.c +++ b/repo-config.c @@ -48,11 +48,13 @@ static int show_config(const char* key_, const char* value_) static int get_value(const char* key_, const char* regex_) { int i; + char *tl; - key = malloc(strlen(key_)+1); - for (i = 0; key_[i]; i++) - key[i] = tolower(key_[i]); - key[i] = 0; + key = strdup(key_); + for (tl=key+strlen(key)-1; tl >= key && *tl != '.'; --tl) + *tl = tolower(*tl); + for (tl=key; *tl && *tl != '.'; ++tl) + *tl = tolower(*tl); if (regex_) { if (regex_[0] == '!') {