Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-26 Thread George Papanikolaou
On Tue, Mar 25, 2014 at 6:54 AM, Junio C Hamano gits...@pobox.com wrote: As a tangent, I have a suspicion that the current implementation may be wrong at the beginning of the string. Wouldn't it match abc and abc, even though these two strings shouldn't match? Wouldn't that be accomplished

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-26 Thread Junio C Hamano
George Papanikolaou g3orge@gmail.com writes: On Tue, Mar 25, 2014 at 6:54 AM, Junio C Hamano gits...@pobox.com wrote: As a tangent, I have a suspicion that the current implementation may be wrong at the beginning of the string. Wouldn't it match abc and abc, even though these two

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-24 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: -while ((*last1 == '\r') || (*last1 == '\n')) +while (iswspace(*last1)) last1--; -while ((*last2 == '\r') || (*last2 == '\n')) +while (iswspace(*last2)) last2--; /* skip leading whitespace */

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-22 Thread George Papanikolaou
On Sat, Mar 22, 2014 at 12:46 AM, Eric Sunshine sunsh...@sunshineco.com wrote: Because it's unnecessary and invites confusion from people reading the code since they now have to wonder if there is something unusual and non-obvious going. Worse, the two loops immediately below the ones you

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-21 Thread Michael Haggerty
On 03/20/2014 08:39 PM, George Papanikolaou wrote: Removing the bloat of checking for both '\r' and '\n' with the prettier iswspace() function which checks for other characters as well. (read: \f \t \v) --- This is one more try to clean up this fuzzy_matchlines() function as part of a

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-21 Thread Eric Sunshine
[Please reply on-list to review comments. Other people may learn from the discussion or have comments of their own.] On Fri, Mar 21, 2014 at 6:00 PM, George Papanikolaou g3orge@gmail.com wrote: On Fri, Mar 21, 2014 at 4:48 AM, Eric Sunshine sunsh...@sunshineco.com wrote: Did you verify

[PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-20 Thread George Papanikolaou
Removing the bloat of checking for both '\r' and '\n' with the prettier iswspace() function which checks for other characters as well. (read: \f \t \v) --- This is one more try to clean up this fuzzy_matchlines() function as part of a microproject for GSOC. The rest more clarrified microprojects

Re: [PATCH] builtin/apply.c: use iswspace() to detect line-ending-like chars

2014-03-20 Thread Eric Sunshine
On Thu, Mar 20, 2014 at 3:39 PM, George Papanikolaou g3orge@gmail.com wrote: Removing the bloat of checking for both '\r' and '\n' with the prettier iswspace() function which checks for other characters as well. (read: \f \t \v) Use imperative mood. Remove rather than Removing. Bloat?