summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 409d1d2)
raw | patch | inline | side by side (parent: 409d1d2)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 16 Aug 2006 23:07:20 +0000 (16:07 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 17 Aug 2006 04:08:45 +0000 (21:08 -0700) |
Parsing of a binary hunk did not consume the terminating blank
line. When applying in reverse, it did not use the second,
reverse binary hunk.
Signed-off-by: Junio C Hamano <junkio@cox.net>
line. When applying in reverse, it did not use the second,
reverse binary hunk.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-apply.c | patch | blob | history |
diff --git a/builtin-apply.c b/builtin-apply.c
index 4f0eef0ac3c2d20475b0b50e81f4d51cd4f95396..be6e94d3674208de86edb0561bfcddb3d9177224 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
llen = linelen(buffer, size);
used += llen;
linenr++;
- if (llen == 1)
+ if (llen == 1) {
+ /* consume the blank line */
+ buffer++;
+ size--;
break;
+ }
/* Minimum line is "A00000\n" which is 7-byte long,
* and the line length must be multiple of 5 plus 2.
*/
@@ -1618,7 +1622,7 @@ static int apply_binary_fragment(struct buffer_desc *desc, struct patch *patch)
"without the reverse hunk to '%s'",
patch->new_name
? patch->new_name : patch->old_name);
- fragment = fragment;
+ fragment = fragment->next;
}
data = (void*) fragment->patch;
switch (fragment->binary_patch_method) {
write_sha1_file_prepare(desc->buffer, desc->size, blob_type,
sha1, hdr, &hdrlen);
if (strcmp(sha1_to_hex(sha1), patch->new_sha1_prefix))
- return error("binary patch to '%s' creates incorrect result", name);
+ return error("binary patch to '%s' creates incorrect result (expecting %s, got %s)", name, patch->new_sha1_prefix, sha1_to_hex(sha1));
}
return 0;