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))