From 5a17b54ad5543ddca60a493c613801279cc98a34 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 9 Jan 2007 02:52:31 -0800 Subject: [PATCH] Do not ignore a detected patchfile brokenness. find_header() function is used to read and parse the patchfile and it detects errors in the patch, but one place ignored the error and went ahead, which was quite bad. Noticed by Jeff Garzik. Signed-off-by: Junio C Hamano --- builtin-apply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-apply.c b/builtin-apply.c index 61f047fd4..6a06be302 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -812,7 +812,7 @@ static int find_header(char *line, unsigned long size, int *hdrsize, struct patc struct fragment dummy; if (parse_fragment_header(line, len, &dummy) < 0) continue; - error("patch fragment without header at line %d: %.*s", linenr, (int)len-1, line); + return error("patch fragment without header at line %d: %.*s", linenr, (int)len-1, line); } if (size < len + 6) -- 2.30.2