summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d317e43)
raw | patch | inline | side by side (parent: d317e43)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 2 Nov 2005 21:02:57 +0000 (13:02 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 3 Nov 2005 00:50:58 +0000 (16:50 -0800) |
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: Junio C Hamano <junkio@cox.net>
DOSsy machine on UNIXy machine. Ignore '\r' immediately
followed by '\n'.
Signed-off-by: Junio C Hamano <junkio@cox.net>
config.c | patch | blob | history |
diff --git a/config.c b/config.c
index 519fecfee4cd7344b538528f7fa923b7fda280d2..e89bab26c99f95e6bb7d3346343ab0c623843c42 100644 (file)
--- a/config.c
+++ b/config.c
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) {