Re: [PATCH 3/4] attr.c::path_matches(): special case paths that end with a slash

2013-03-28 Thread Jeff King
On Tue, Mar 26, 2013 at 03:05:58PM -0400, Jeff King wrote: On Tue, Mar 26, 2013 at 11:39:30AM -0700, Junio C Hamano wrote: A similar adjustment for match_pathname() might be needed, but I didn't look into it. [...] We do seem to use strncmp_icase through the rest of the function,

Re: [PATCH 3/4] attr.c::path_matches(): special case paths that end with a slash

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 11:39:30AM -0700, Junio C Hamano wrote: A similar adjustment for match_pathname() might be needed, but I didn't look into it. I notice that match_pathname takes _two_ lengths for the pattern: the nowildcardlen (called prefix, and the full patternlen). But the first

Re: [PATCH 3/4] attr.c::path_matches(): special case paths that end with a slash

2013-03-26 Thread Jeff King
On Tue, Mar 26, 2013 at 03:05:58PM -0400, Jeff King wrote: On Tue, Mar 26, 2013 at 11:39:30AM -0700, Junio C Hamano wrote: A similar adjustment for match_pathname() might be needed, but I didn't look into it. I notice that match_pathname takes _two_ lengths for the pattern: the

Re: [PATCH 3/4] attr.c::path_matches(): special case paths that end with a slash

2013-03-26 Thread Duy Nguyen
On Wed, Mar 27, 2013 at 4:33 AM, Jeff King p...@peff.net wrote: Hmm. match_pathname does have this: /* * baselen does not count the trailing slash. base[] may or * may not end with a trailing slash though. */ if (pathlen baselen + 1 ||