X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;ds=sidebyside;f=dir.c;h=b2dfb69eb5606a7538cc5e1876a91f703ec4969c;hb=1f238da57334ca0155ae7560b173eefc8c4c157a;hp=133f472a1e73786e781c1021eea17e543858937f;hpb=9f44723d1a2c6a97306a7160deeab621e08bea7a;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;