{"thread":{"id":"12345","subject":"[PATCH] git-apply --whitespace=fix: fix off by one thinko","startedAt":"2008-02-27T19:48:21Z","lastAt":"2008-02-27T19:48:21Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"70149","messageId":"7vk5kqtc3e.fsf@gitster.siamese.dyndns.org","threadId":"12345","inReplyTo":null,"subject":"[PATCH] git-apply --whitespace=fix: fix off by one thinko","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-27T19:48:21Z","receivedAt":"2008-02-27T19:48:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When a patch adds a whitespace followed by end-of-line, the\ntrailing whitespace error was detected correctly but was not\nfixed, due to misconversion in 42ab241 (builtin-apply.c: do not\nfeed copy_wsfix() leading '+').\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n ws.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/ws.c b/ws.c\nindex 522f646..ba7e834 100644\n--- a/ws.c\n+++ b/ws.c\n@@ -234,7 +234,7 @@ int ws_fix_copy(char *dst, const char *src, int len, unsigned ws_rule, int *erro\n \t * Strip trailing whitespace\n \t */\n \tif ((ws_rule & WS_TRAILING_SPACE) &&\n-\t    (2 < len && isspace(src[len-2]))) {\n+\t    (2 <= len && isspace(src[len-2]))) {\n \t\tif (src[len - 1] == '\\n') {\n \t\t\tadd_nl_to_tail = 1;\n \t\t\tlen--;\n-- \n1.5.4.3.339.gad2d1\n"}]}