Re: [PATCH 2/3] tree-walk: simplify via strnncmp()
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jun 16, 2014, 20:18 UTC
- Message-ID
- <20140616201806.GO8557@google.com>
- In-Reply-To
- <571d131f6ebeadb33999fe086656cb642710fb6f.1402945507.git.jmmahler@gmail.com>
Jeremiah Mahler wrote:
> --- a/tree-walk.c > +++ b/tree-walk.c
[...]
Show 6 quoted lines
> @@ -174,7 +164,7 @@ static int check_entry_match(const char *a, int a_len, const char *b, int b_len) > * scanning further. > */ > > - int cmp = name_compare(a, a_len, b, b_len); > + int cmp = strnncmp(a, a_len, b, b_len);
This changes behavior: the old version would only have 0 < cmp if 'a' comes after 'b', while the new version always has 0 < cmp when a != b.