X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=dir.c;h=b2dfb69eb5606a7538cc5e1876a91f703ec4969c;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=133f472a1e73786e781c1021eea17e543858937f;hpb=ae76cb90cb835f9df42e849206ab55a1e1e1eea3;p=git.git diff --git a/dir.c b/dir.c index 133f472a1..b2dfb69eb 100644 --- a/dir.c +++ b/dir.c @@ -232,7 +232,7 @@ int add_excludes_from_file_to_list(const char *fname, { struct stat st; int fd, i; - size_t size; + size_t size = 0; char *buf, *entry; fd = open(fname, O_RDONLY); @@ -360,7 +360,8 @@ int excluded_from_list(const char *pathname, if (x->flags & EXC_FLAG_MUSTBEDIR) { if (!dtype) { - if (!prefixcmp(pathname, exclude)) + if (!prefixcmp(pathname, exclude) && + pathname[x->patternlen] == '/') return to_exclude; else continue;