From: Junio C Hamano Date: Tue, 9 Jan 2007 10:52:31 +0000 (-0800) Subject: Do not ignore a detected patchfile brokenness. X-Git-Tag: v1.5.0-rc1~36^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5a17b54ad5543ddca60a493c613801279cc98a34;p=git.git 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 --- 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)