From 076426e7964dbe70c08c59b2ebd46cb6c4d6a503 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 3 Mar 2021 09:29:10 -0700 Subject: [PATCH] unbreak unzip Commit 71b7f21fdb changed the scope of a shadowing binding. --- racket/collects/file/unzip.rkt | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/racket/collects/file/unzip.rkt b/racket/collects/file/unzip.rkt index a090b2a76e..0581d85fdd 100644 --- a/racket/collects/file/unzip.rkt +++ b/racket/collects/file/unzip.rkt @@ -203,21 +203,22 @@ [in0 (if (bitwise-bit-set? bits 3) in (make-limited-input-port in compressed #f))]) - (define-values (in t) - (if (zero? compression) - (values in0 #f) - (make-filter-input-port inflate in0))) - - (if preserve-timestamps? - (read-entry filename dir? in (and (not dir?) - (msdos-date+time->seconds date time utc?))) - (read-entry filename dir? in)) + (let () + (define-values (in t) + (if (zero? compression) + (values in0 #f) + (make-filter-input-port inflate in0))) + + (if preserve-timestamps? + (read-entry filename dir? in (and (not dir?) + (msdos-date+time->seconds date time utc?))) + (read-entry filename dir? in)) - ;; Read until the end of the deflated stream when compressed size unknown - (when (bitwise-bit-set? bits 3) - (let loop () (unless (eof-object? (read-bytes 1024 in)) (loop)))) + ;; Read until the end of the deflated stream when compressed size unknown + (when (bitwise-bit-set? bits 3) + (let loop () (unless (eof-object? (read-bytes 1024 in)) (loop)))) - (when t (kill-thread t)) + (when t (kill-thread t))) ;; appnote VI-C : if bit 3 is set, then the file data ;; is immediately followed by a data descriptor