Re: [PATCH v2 0/3] add strnncmp() function

2014-06-18 Thread Ondřej Bílka
On Tue, Jun 17, 2014 at 01:08:05PM +0200, Torsten Bögershausen wrote: > On 2014-06-17 09.34, Jeremiah Mahler wrote: > > Add a strnncmp() function which behaves like strncmp() except it takes > > the length of both strings instead of just one. > > > > Then simplify tree-walk.c and unpack-trees.c us

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jeremiah Mahler
Jonathan, On Tue, Jun 17, 2014 at 10:48:17AM -0700, Jonathan Nieder wrote: > >> On 2014-06-17 09.34, Jeremiah Mahler wrote: > > >>> Also, strnncmp() was switched from using memcmp() to strncmp() > >>> internally to make it clear that this is meant for strings, not > >>> general buffers. > > Why

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jonathan Nieder
>> On 2014-06-17 09.34, Jeremiah Mahler wrote: >>> Also, strnncmp() was switched from using memcmp() to strncmp() >>> internally to make it clear that this is meant for strings, not >>> general buffers. Why shouldn't I want to use this helper on arbitrary data? One of the advantages of other hel

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jeremiah Mahler
Torsten, On Tue, Jun 17, 2014 at 01:08:05PM +0200, Torsten Bögershausen wrote: > On 2014-06-17 09.34, Jeremiah Mahler wrote: > > Add a strnncmp() function which behaves like strncmp() except it takes > > the length of both strings instead of just one. > > > > Then simplify tree-walk.c and unpack-

Re: [PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Torsten Bögershausen
On 2014-06-17 09.34, Jeremiah Mahler wrote: > Add a strnncmp() function which behaves like strncmp() except it takes > the length of both strings instead of just one. > > Then simplify tree-walk.c and unpack-trees.c using this new function. > Replace all occurrences of name_compare() with strnncmp

[PATCH v2 0/3] add strnncmp() function

2014-06-17 Thread Jeremiah Mahler
Add a strnncmp() function which behaves like strncmp() except it takes the length of both strings instead of just one. Then simplify tree-walk.c and unpack-trees.c using this new function. Replace all occurrences of name_compare() with strnncmp(). Remove name_compare(), which they both had identi