X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=config.c;h=e89bab26c99f95e6bb7d3346343ab0c623843c42;hb=bb73d73c0885fce357e0d70aa51c2215a8e38a4e;hp=cf803580c9447540627fdc8db0039fa456b7b255;hpb=e1b10391eabdaaa4c89c53099dd96d5f9d978719;p=git.git diff --git a/config.c b/config.c index cf803580..e89bab26 100644 --- a/config.c +++ b/config.c @@ -1,4 +1,3 @@ -#include #include "cache.h" @@ -14,6 +13,14 @@ static int get_next_char(void) c = '\n'; if ((f = config_file) != NULL) { c = fgetc(f); + if (c == '\r') { + /* DOS like systems */ + c = fgetc(f); + if (c != '\n') { + ungetc(c, f); + c = '\r'; + } + } if (c == '\n') config_linenr++; if (c == EOF) { @@ -168,7 +175,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; }