[PATCH v2 0/6] attribute regression fix for maint-1.8.1 and upward
- From
Jeff King <peff@peff.net>
- Date
- Mar 28, 2013, 21:43 UTC
- Message-ID
- <20130328214358.GA10685@sigill.intra.peff.net>
- In-Reply-To
- <1364323171-20299-1-git-send-email-gitster@pobox.com>
On Tue, Mar 26, 2013 at 11:39:27AM -0700, Junio C Hamano wrote:
> So here is an attempt to fix the unintended regression, on top of > 9db9eecfe5c2 (attr: avoid calling find_basename() twice per path, > 2013-01-16). It consists of four patches.
Here's my update to the series. I think this should fix all of the issues. And it should be very easy to drop in Duy's nwildmatch later on; it can just replace the fnmatch_icase_mem function added in patch 2 below.
The main fix in this iteration is that match_pathname receives the same treatment as match_basename, which is done in patches 3 and 4 (the issues were subtly different enough that I didn't want to squash it all together; plus, gotta keep that commit count up).
[1/6]: attr.c::path_matches(): the basename is part of the pathname [2/6]: dir.c::match_basename(): pay attention to the length of string parameters [3/6]: dir.c::match_pathname(): adjust patternlen when shifting pattern [4/6]: dir.c::match_pathname(): pay attention to the length of string parameters [5/6]: attr.c::path_matches(): special case paths that end with a slash [6/6]: t: check that a pattern without trailing slash matches a directory
-Peff
PS I followed your subject-naming convention since I was adding into your series, but it seems quite long to me. I would have just said: "match_basename: pay attention...".