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

2014-03-26 Thread Junio C Hamano
George Papanikolaou writes: > On Tue, Mar 25, 2014 at 6:54 AM, Junio C Hamano 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? > > Woul

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 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 by just remo

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

2014-03-24 Thread Junio C Hamano
Michael Haggerty 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-23 Thread Eric Sunshine
On Sat, Mar 22, 2014 at 5:33 AM, George Papanikolaou wrote: > On Sat, Mar 22, 2014 at 12:46 AM, Eric Sunshine > 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, th

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 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 > changed, as well as th

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 wrote: > On Fri, Mar 21, 2014 at 4:48 AM, Eric Sunshine > wrote: >> >> Did you verify that it is safe to strip all whitespace

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-20 Thread Eric Sunshine
On Thu, Mar 20, 2014 at 3: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) Use imperative mood. "Remove" rather than "Removing". Bloat? Prettier? Subjec

[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 w