aboutsummaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/apply.c b/apply.c
index 63d5e3c460..4aa1694cfa 100644
--- a/apply.c
+++ b/apply.c
@@ -1840,8 +1840,16 @@ static int parse_fragment(struct apply_state *state,
trailing++;
check_old_for_crlf(patch, line, len);
if (!state->apply_in_reverse &&
- state->ws_error_action == correct_ws_error)
- check_whitespace(state, line, len, patch->ws_rule);
+ state->ws_error_action == correct_ws_error) {
+ const char *test_line = line;
+ int test_len = len;
+ if (*line == '\n') {
+ test_line = " \n";
+ test_len = 2;
+ }
+ check_whitespace(state, test_line, test_len,
+ patch->ws_rule);
+ }
break;
case '-':
if (!state->apply_in_reverse)