From: Jonathan Nieder Date: Mon, 16 Jun 2014 20:19:05 GMT Subject: Re: [PATCH 3/3] unpack-trees: simplify via strnncmp() Message-ID: <20140616201905.GP8557@google.com> In-Reply-To: Jeremiah Mahler wrote: > --- a/unpack-trees.c > +++ b/unpack-trees.c [...] > @@ -678,7 +667,7 @@ static int find_cache_pos(struct traverse_info *info, > ce_len = ce_slash - ce_name; > else > ce_len = ce_namelen(ce) - pfxlen; > - cmp = name_compare(p->path, p_len, ce_name, ce_len); > + cmp = strnncmp(p->path, p_len, ce_name, ce_len); Likewise --- the sign of the result is important here.