{"thread":{"id":"7532","subject":"[PATCH 03/13] make close optional (like checksum) in csum-file.c:sha1close","startedAt":"2007-04-05T22:26:52Z","lastAt":"2007-04-05T22:26:52Z","messageCount":1,"participants":["Dana How"],"isPatch":true,"patchVersion":1,"patchTotal":13},"messages":[{"id":"38744","messageId":"56b7f5510704051526o4067ed4al948ba0767adc458b@mail.gmail.com","threadId":"7532","inReplyTo":null,"subject":"[PATCH 03/13] make close optional (like checksum) in csum-file.c:sha1close","fromName":"Dana How","fromEmail":"danahow@gmail.com","sentAt":"2007-04-05T22:26:52Z","receivedAt":"2007-04-05T22:26:52Z","isPatch":true,"sender":{"key":"danahow@gmail.com","avatar":null},"body":"---\n csum-file.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\n-- \nDana L. How  danahow@gmail.com  +1 650 804 5991 cell\n\n\nFrom ee5b6c88c38950eab4a7815120d72cf34ed0f100 Mon Sep 17 00:00:00 2001\nFrom: Dana How <how@deathvalley.cswitch.com>\nDate: Thu, 5 Apr 2007 12:21:58 -0700\nSubject: [PATCH 03/13] make close optional (like checksum) in csum-file.c:sha1close\n\n---\n csum-file.c |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/csum-file.c b/csum-file.c\nindex b7174c6..e1ff769 100644\n--- a/csum-file.c\n+++ b/csum-file.c\n@@ -35,7 +35,10 @@ int sha1close(struct sha1file *f, unsigned char *result, int update)\n \tif (offset) {\n \t\tSHA1_Update(&f->ctx, f->buffer, offset);\n \t\tsha1flush(f, offset);\n+\t\tf->offset = 0;\n \t}\n+\tif (update < 0)\n+\t\treturn 0;\t/* only want to flush (no checksum write, no close) */\n \tSHA1_Final(f->buffer, &f->ctx);\n \tif (result)\n \t\thashcpy(result, f->buffer);\n-- \n1.5.1.rc2.18.g9c88-dirty\n\n"}]}