diff options
| author | Junio C Hamano <junkio@cox.net> | 2005-11-02 13:02:57 -0800 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2005-11-02 16:50:58 -0800 |
| commit | db2c075d9375a32b8010d2b17c1d420aa8696710 (patch) | |
| tree | 2ec5549cac0b8a08c1d4303e34b8fb21224f9a1f | |
| parent | remove CR/LF from .gitignore (diff) | |
| download | git-db2c075d9375a32b8010d2b17c1d420aa8696710.tar.gz git-db2c075d9375a32b8010d2b17c1d420aa8696710.zip | |
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: Junio C Hamano <junkio@cox.net>
| -rw-r--r-- | config.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) { |
