1
0
mirror of https://github.com/git/git.git synced 2024-09-28 06:30:37 +02:00

Fix git-fast-export for zero-sized blobs

Writing 1 elements of size 0-byte successfully will cause fwrite(3) to
return 0, and flagging it as error is a mistake.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen 2007-12-11 23:01:28 +01:00 committed by Junio C Hamano
parent d4110a9726
commit b0fe0d7258

View File

@ -103,7 +103,7 @@ static void handle_object(const unsigned char *sha1)
mark_object(object);
printf("blob\nmark :%d\ndata %lu\n", last_idnum, size);
if (fwrite(buf, size, 1, stdout) != 1)
if (size && fwrite(buf, size, 1, stdout) != 1)
die ("Could not write blob %s", sha1_to_hex(sha1));
printf("\n");