From 6cf91492d9cd985e1fa65181d99d6d578d4439dc Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 4 Jul 2008 21:10:14 +0200 Subject: Fix apply --recount handling of no-EOL line If a patch modifies the last line of a file that previously had no terminating '\n', it looks like -old text \ No newline at end of file +new text Hence, a '\' line does not signal the end of the hunk. This modifies 'git apply --recount' to take this into account. Signed-off-by: Thomas Rast Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- builtin-apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin-apply.c') diff --git a/builtin-apply.c b/builtin-apply.c index 9fcfe3955d..c0f867daed 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -919,7 +919,7 @@ static void recount_diff(char *line, int size, struct fragment *fragment) newlines++; continue; case '\\': - break; + continue; case '@': ret = size < 3 || prefixcmp(line, "@@ "); break; -- cgit v1.2.3