summaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2005-11-02 13:05:45 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-03 00:50:58 (GMT)
commitd317e4384acd5646f2ba44197a531c129b26b57e (patch)
tree29e2eac910f75f58e824d17972a93a52c1a0db47 /ls-files.c
parent13d1cc3604a1a64cb5a6025bba8af8b74a373963 (diff)
downloadgit-d317e4384acd5646f2ba44197a531c129b26b57e.zip
git-d317e4384acd5646f2ba44197a531c129b26b57e.tar.gz
git-d317e4384acd5646f2ba44197a531c129b26b57e.tar.bz2
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 <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c
index 3085b2f..d9c8b21 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;