提交 db2c075d 编写于 作者: J Junio C Hamano

Ignore '\r' at the end of line in $GIT_DIR/config

Unfortunate people may have to use $GIT_DIR/config edited on
DOSsy machine on UNIXy machine.  Ignore '\r' immediately
followed by '\n'.
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 d317e438
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册