From bc19622c8c9b6af2635da30ed9c88665012d3361 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 3 Dec 2004 12:49:45 +0000 Subject: [PATCH] 0.8.17.18: Fix for a couple of Unicode-related bugs. ... KLUDGE around the non-existence of proper external-format support in GET-DESCRIPTOR-FOR / RUN-PROGRAM; ... hideous hack in asdf-install to allow downloads of binary data through character streams. --- NEWS | 5 +++++ contrib/asdf-install/installer.lisp | 6 +++--- src/code/run-program.lisp | 11 ++++++++++- tests/run-program.test.sh | 7 +++++++ version.lisp-expr | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index bbe115d..bf75bd5 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,11 @@ changes in sbcl-0.8.18 relative to sbcl-0.8.17: * bug fix: RANDOM can be compiled when the compiler derives the type of its numeric argument as a disjoint set of small integers. (reported by Paul Dietz) + * fixed some bugs related to Unicode integration: + ** RUN-PROGRAM can allow its child to take input from a Lisp + stream. (reported by Stefan Scholl) + ** ASDF-INSTALL successfully downloads .tar.gz files in all + locales. (reported by Ken Causey) * fixed some bugs revealed by Paul Dietz' test suite: ** INCF, DECF and REMF evaluate their place form as specified in CLtS 5.1.3. diff --git a/contrib/asdf-install/installer.lisp b/contrib/asdf-install/installer.lisp index d17d7e1..3acb93a 100644 --- a/contrib/asdf-install/installer.lisp +++ b/contrib/asdf-install/installer.lisp @@ -109,7 +109,7 @@ (socket-connect s (car (host-ent-addresses (get-host-by-name (url-host (or *proxy* url))))) (url-port (or *proxy* url))) - (let ((stream (socket-make-stream s :input t :output t :buffering :full))) + (let ((stream (socket-make-stream s :input t :output t :buffering :full :external-format :iso-8859-1))) ;; we are exceedingly unportable about proper line-endings here. ;; Anyone wishing to run this under non-SBCL should take especial care (format stream "GET ~A HTTP/1.0~%Host: ~A~%Cookie: CCLAN-SITE=~A~%~%" @@ -150,11 +150,11 @@ (format t "Downloading ~A bytes from ~A ..." (if length length "some unknown number of") url) (force-output) - (with-open-file (o file-name :direction :output) + (with-open-file (o file-name :direction :output :external-format :iso-8859-1) (if length (let ((buf (make-array length :element-type - (stream-element-type stream) ))) + (stream-element-type stream)))) (read-sequence buf stream) (write-sequence buf o)) (sb-executable:copy-stream stream o)))) diff --git a/src/code/run-program.lisp b/src/code/run-program.lisp index 408b050..f2dfe10 100644 --- a/src/code/run-program.lisp +++ b/src/code/run-program.lisp @@ -753,7 +753,16 @@ (read-line object nil nil) (unless line (return)) - (sb-unix:unix-write fd line 0 (length line)) + (sb-unix:unix-write + fd + ;; FIXME: this really should be + ;; (STRING-TO-OCTETS :EXTERNAL-FORMAT ...). + ;; RUN-PROGRAM should take an + ;; external-format argument, which should + ;; be passed down to here. Something + ;; similar should happen on :OUTPUT, too. + (map '(vector (unsigned-byte 8)) #'char-code line) + 0 (length line)) (if no-cr (return) (sb-unix:unix-write fd newline 0 1))))) diff --git a/tests/run-program.test.sh b/tests/run-program.test.sh index 84a93c5..00399d1 100644 --- a/tests/run-program.test.sh +++ b/tests/run-program.test.sh @@ -57,6 +57,13 @@ ${SBCL:-sbcl} <