Thread (37 messages) flat view 37 messages, 5 authors, 2016-06-15

Re: [PATCH 1/4] attr.c::path_matches(): the basename is part of the pathname

From: Jeff King <hidden>
Date: 2016-06-15 22:56:31

On Tue, Mar 26, 2013 at 11:39:28AM -0700, Junio C Hamano wrote:
The function takes two strings (pathname and basename) as if they
are independent strings, but in reality, the latter is always
pointing into a substring in the former.

Clarify this relationship by expressing the latter as an offset into
the former.

Signed-off-by: Junio C Hamano <redacted>
This is a huge improvement in maintainability. My initial fix attempt
was to just xstrdup() the strings (knowing that the performance would be
horrible, but I was still investigating correctness issues at that
point). And of course I ran into this same issue as I tried to make a
copy of pathname.

So even without the rest of the fix, this is definitely a good idea. :)

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help