Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Pasha Bolokhov
Thanks for the fix. I knew these backslashes could cause trouble. No doubt the fixed version reads better than a hundred backslashes On Fri, Jun 13, 2014 at 4:25 PM, Jeff King wrote: > On Fri, Jun 13, 2014 at 01:23:47PM -0700, Junio C Hamano wrote: > >> This passes with your shell set to dash bu

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Jeff King
On Fri, Jun 13, 2014 at 01:23:47PM -0700, Junio C Hamano wrote: > This passes with your shell set to dash but fails with bash. > > Let's fix it up like so. Thanks, I should have been more suspicious of the combination of backslashes and echo during review. :) > diff --git a/t/t0008-ignores.sh b

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-13 Thread Junio C Hamano
Pasha Bolokhov writes: > diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh > index 63beb99..5ef5ad3 100755 > --- a/t/t0008-ignores.sh > +++ b/t/t0008-ignores.sh > @@ -806,4 +806,27 @@ test_expect_success !MINGW 'quoting allows trailing > whitespace' ' > test_cmp err.expect err > ' >

Re: [PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-02 Thread Junio C Hamano
Pasha Bolokhov writes: > Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and > improve the 'if' structure. Switch to pointers instead of integers > > Slightly more rare occurrences of 'text \' with a backslash > in between spaces are handled correctly. Namely, the code in > 8

[PATCH alt-v3] Improve function dir.c:trim_trailing_spaces()

2014-06-02 Thread Pasha Bolokhov
Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and improve the 'if' structure. Switch to pointers instead of integers Slightly more rare occurrences of 'text \' with a backslash in between spaces are handled correctly. Namely, the code in 8ba87adad6 does not reset 'last_space