From: Junio C Hamano Date: Tue, 10 Jan 2012 19:25:19 GMT Subject: Re: [PATCH] attr: don't confuse prefixes with leading directories Message-ID: <7vhb039x7k.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120110180820.GA15273@sigill.intra.peff.net> Jeff King writes: > diff --git a/attr.c b/attr.c > index 76b079f..fa975da 100644 > --- a/attr.c > +++ b/attr.c > @@ -582,7 +582,8 @@ static void prepare_attr_stack(const char *path) > > elem = attr_stack; > if (namelen <= dirlen && > - !strncmp(elem->origin, path, namelen)) > + !strncmp(elem->origin, path, namelen) && > + (!namelen || path[namelen] == '/')) > break; Thanks for the fix; I was looking at path_matches() and wondering about the same thing.