X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=apply.c;h=c50b3a60464ea05307af8e8d1be576cf96415ff0;hb=cb0c6df6f5e850875af28b47c5c94482a326293f;hp=2da225a8ecae356c1b3376d5a0671940f265509c;hpb=3103cf9e1e09b0045a60542f24a2a1e4ed7b1237;p=git.git diff --git a/apply.c b/apply.c index 2da225a8..c50b3a60 100644 --- a/apply.c +++ b/apply.c @@ -693,7 +693,7 @@ static int parse_range(const char *line, int len, int offset, const char *expect line += digits; len -= digits; - *p2 = *p1; + *p2 = 1; if (*line == ',') { digits = parse_num(line+1, p2); if (!digits) @@ -901,6 +901,8 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s break; } } + if (oldlines || newlines) + return -1; /* If a fragment ends with an incomplete line, we failed to include * it in the above loop because we hit oldlines == newlines == 0 * before seeing it.