From d317e4384acd5646f2ba44197a531c129b26b57e Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Wed, 2 Nov 2005 14:05:45 +0100 Subject: remove CR/LF from .gitignore For everyone cursed by dos/windows line endings (aka CRLF): The code reading the .gitignore files (excludes and excludes per directory) leaves \r in the patterns, which causes fnmatch to fail for no obvious reason. Just remove a "\r" preceding a "\n" unconditionally. Signed-off-by: Junio C Hamano --- ls-files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ls-files.c') diff --git a/ls-files.c b/ls-files.c index 3085b2fc8..d9c8b215f 100644 --- a/ls-files.c +++ b/ls-files.c @@ -97,7 +97,7 @@ static int add_excludes_from_file_1(const char *fname, for (i = 0; i < size; i++) { if (buf[i] == '\n') { if (entry != buf + i && entry[0] != '#') { - buf[i] = 0; + buf[i - (i && buf[i-1] == '\r')] = 0; add_exclude(entry, base, baselen, which); } entry = buf + i + 1; -- cgit v1.2.1