From ac0edb679bd8a2c0e55822a665e8dedf0f2e659b Mon Sep 17 00:00:00 2001 From: eknauel Date: Wed, 14 Sep 2005 11:07:15 +0000 Subject: [PATCH] Fix md5-digest-for-port: Don't fail if the total number of bytes read from a port exactly matches the buffer size --- scsh/md5.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scsh/md5.scm b/scsh/md5.scm index 7350168..7d8d8d6 100644 --- a/scsh/md5.scm +++ b/scsh/md5.scm @@ -70,7 +70,9 @@ (init-md5-context! context) (let lp () (let ((got (read-block buffer 0 buffer-size port))) - (cond ((< got buffer-size) + (cond ((eof-object? got) + (md5-context->md5-digest context)) + ((< got buffer-size) (if (not (eof-object? (peek-char port))) (error "read-block didn't read port to the end")) (update-md5-context! context (substring buffer 0 got))