fix for PR8331

svn: r4487

original commit: 4f7cc1e56b37485e565f5b0e3ed2d93ac51f49b8
This commit is contained in:
Eli Barzilay 2006-10-05 01:54:36 +00:00
parent dcaa481278
commit ddd6157459

View File

@ -2050,8 +2050,7 @@
;; * Write out any remaining bits in an incomplete byte. ;; * Write out any remaining bits in an incomplete byte.
;; */ ;; */
(define (bi_windup) (define (bi_windup)
(cond (cond [(> bi_valid 8)
[(> bi_valid 8)
(put_short bi_buf)] (put_short bi_buf)]
[(> bi_valid 0) [(> bi_valid 0)
(put_byte bi_buf)]) (put_byte bi_buf)])
@ -2256,6 +2255,12 @@
(define flags (if origname #x8 0)) ;; /* general purpose bit flags */ (define flags (if origname #x8 0)) ;; /* general purpose bit flags */
;; make origname be a byte string
(set! origname (cond [(not origname) #f]
[(string? origname) (string->bytes/utf-8 origname)]
[(path? origname) (path->bytes origname)]
[else origname]))
(set! bytes_in 0) (set! bytes_in 0)
(set! ifd in) (set! ifd in)
@ -2280,7 +2285,7 @@
(put_byte 3) ;; /* OS identifier */ (put_byte 3) ;; /* OS identifier */
(when origname (when origname
(for-each put_byte (map char->integer (string->list origname))) (for-each put_byte (bytes->list origname))
(put_byte 0)) (put_byte 0))
(do-deflate) (do-deflate)