Skip to content

Commit

Permalink
git-apply --whitespace=fix: fix off by one thinko
Browse files Browse the repository at this point in the history
When a patch adds a whitespace followed by end-of-line, the
trailing whitespace error was detected correctly but was not
fixed, due to misconversion in 42ab241 (builtin-apply.c: do not
feed copy_wsfix() leading '+').

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 26, 2008
1 parent 2db511f commit c6fabfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ int ws_fix_copy(char *dst, const char *src, int len, unsigned ws_rule, int *erro
* Strip trailing whitespace
*/
if ((ws_rule & WS_TRAILING_SPACE) &&
(2 < len && isspace(src[len-2]))) {
(2 <= len && isspace(src[len-2]))) {
if (src[len - 1] == '\n') {
add_nl_to_tail = 1;
len--;
Expand Down

0 comments on commit c6fabfa

Please sign in to comment.