X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=config.c;h=519fecfee4cd7344b538528f7fa923b7fda280d2;hb=adc3dbca1aed4e8b25dd9b77463bbe87f7e86b94;hp=510456ceb59d5608d13164fe976631b3ba874fd6;hpb=5cbb401dbaff5fd810a85b84333cb0c22d264f36;p=git.git diff --git a/config.c b/config.c index 510456ce..519fecfe 100644 --- a/config.c +++ b/config.c @@ -1,4 +1,3 @@ -#include #include "cache.h" @@ -168,7 +167,7 @@ static int git_parse_file(config_fn_t fn) } if (!isalpha(c)) break; - var[baselen] = c; + var[baselen] = tolower(c); if (get_value(fn, var, baselen+1) < 0) break; } @@ -207,6 +206,16 @@ int git_default_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "user.name")) { + strncpy(git_default_name, value, sizeof(git_default_name)); + return 0; + } + + if (!strcmp(var, "user.email")) { + strncpy(git_default_email, value, sizeof(git_default_email)); + return 0; + } + /* Add other config variables here.. */ return 0; }