X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=config.c;h=e89bab26c99f95e6bb7d3346343ab0c623843c42;hb=df8171ccb34ef346799b8bc2794d8707209c91d1;hp=519fecfee4cd7344b538528f7fa923b7fda280d2;hpb=2b2dabc29f53c5835868029585000ee487cf6cbb;p=git.git diff --git a/config.c b/config.c index 519fecfe..e89bab26 100644 --- a/config.c +++ b/config.c @@ -13,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) {