X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=ls-files.c;h=d9c8b215f1dcc48ebd7de9f92713f43a09a80e66;hb=c17fb6ee074cb0c9d71e5de42e2ad00786fedc18;hp=3085b2fc8c7e8920ecca8e9c0657d6124b0fbfda;hpb=8ac3a61f59173d4a9a328518be83a25df610a5ef;p=git.git diff --git a/ls-files.c b/ls-files.c index 3085b2fc..d9c8b215 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;