From 71aeb419fb4995526fdd6bfa24823ee3f0869845 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 1 Apr 2014 18:43:24 +0900 Subject: [PATCH] Supporting tar on bytevectors. --- lib/chibi/tar.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/chibi/tar.scm b/lib/chibi/tar.scm index 188ef5d2..358222f0 100644 --- a/lib/chibi/tar.scm +++ b/lib/chibi/tar.scm @@ -73,10 +73,12 @@ ;; fundamental iterator (define (tar-fold src kons knil) - (let ((in (if (string? src) (open-binary-input-file src) src))) + (let ((in (cond ((string? src) (open-binary-input-file src)) + ((bytevector? src) (open-input-bytevector src)) + (else src)))) (let lp ((acc knil)) (cond - ((eof-object? (peek-char in)) + ((eof-object? (peek-u8 in)) (close-input-port in) acc) (else