git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 03/13] make close optional (like checksum) in csum-file.c:sha1close

From
DHDana How <danahow@gmail.com>
Date
Apr 5, 2007, 22:26 UTC
Message-ID
<56b7f5510704051526o4067ed4al948ba0767adc458b@mail.gmail.com>
---
 csum-file.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell


From ee5b6c88c38950eab4a7815120d72cf34ed0f100 Mon Sep 17 00:00:00 2001
From: Dana How <how@deathvalley.cswitch.com>
Date: Thu, 5 Apr 2007 12:21:58 -0700
Subject: [PATCH 03/13] make close optional (like checksum) in csum-file.c:sha1close

---
 csum-file.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/csum-file.c b/csum-file.c
index b7174c6..e1ff769 100644
--- a/csum-file.c
+++ b/csum-file.c
@@ -35,7 +35,10 @@ int sha1close(struct sha1file *f, unsigned char *result, int update)
 	if (offset) {
 		SHA1_Update(&f->ctx, f->buffer, offset);
 		sha1flush(f, offset);
+		f->offset = 0;
 	}
+	if (update < 0)
+		return 0;	/* only want to flush (no checksum write, no close) */
 	SHA1_Final(f->buffer, &f->ctx);
 	if (result)
 		hashcpy(result, f->buffer);
-- 
1.5.1.rc2.18.g9c88-dirty
Message 1 of 1 in “make close optional (like checksum) in csum-file.c:sha1close”
  1. 03/13 make close optional (like checksum) in csum-file.c:sha1closeDana How, Apr 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.