X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=config.c;h=e89bab26c99f95e6bb7d3346343ab0c623843c42;hb=df8171ccb34ef346799b8bc2794d8707209c91d1;hp=9b7c6f2942483c7791277ad659b5683accafab8d;hpb=d06b689a933f6d2130f8afdf1ac0ddb83eeb59ab;p=git.git diff --git a/config.c b/config.c index 9b7c6f29..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) {