X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=82b35624543a2e50d80cafab15b63df0152adbc0;hb=0eaf22f4c4bba89457e733264e71343368712793;hp=3e077d4c6ca4f7162e3a3254e1b3e90db33270ff;hpb=a796b895111d5f4a76be2365dbacef2e17d7d9c9;p=git.git diff --git a/config.c b/config.c index 3e077d4c6..82b356245 100644 --- a/config.c +++ b/config.c @@ -244,9 +244,9 @@ int git_config_bool(const char *name, const char *value) return 1; if (!*value) return 0; - if (!strcasecmp(value, "true")) + if (!strcasecmp(value, "true") || !strcasecmp(value, "yes")) return 1; - if (!strcasecmp(value, "false")) + if (!strcasecmp(value, "false") || !strcasecmp(value, "no")) return 0; return git_config_int(name, value) != 0; } @@ -279,18 +279,38 @@ int git_default_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "core.legacyheaders")) { + use_legacy_headers = git_config_bool(var, value); + return 0; + } + + if (!strcmp(var, "core.compression")) { + int level = git_config_int(var, value); + if (level == -1) + level = Z_DEFAULT_COMPRESSION; + else if (level < 0 || level > Z_BEST_COMPRESSION) + die("bad zlib compression level %d", level); + zlib_compression_level = level; + return 0; + } + if (!strcmp(var, "user.name")) { - safe_strncpy(git_default_name, value, sizeof(git_default_name)); + strlcpy(git_default_name, value, sizeof(git_default_name)); return 0; } if (!strcmp(var, "user.email")) { - safe_strncpy(git_default_email, value, sizeof(git_default_email)); + strlcpy(git_default_email, value, sizeof(git_default_email)); return 0; } if (!strcmp(var, "i18n.commitencoding")) { - safe_strncpy(git_commit_encoding, value, sizeof(git_commit_encoding)); + strlcpy(git_commit_encoding, value, sizeof(git_commit_encoding)); + return 0; + } + + if (!strcmp(var, "pager.color")) { + pager_use_color = git_config_bool(var,value); return 0; }