0.9.7.19:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 7 Dec 2005 15:57:21 +0000 (15:57 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 7 Dec 2005 15:57:21 +0000 (15:57 +0000)
Merge patch (DL "external-formats problem..." 2005-12-03
sbcl-devel)
... and (fixed) test case 2005-12-07

NEWS
contrib/sb-simple-streams/fndb.lisp
contrib/sb-simple-streams/internal.lisp
contrib/sb-simple-streams/simple-stream-tests.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 74e9562..93a54e1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ changes in sbcl-0.9.8 relative to sbcl-0.9.7:
   * bug fix: FILE-STRING-LENGTH is now external-format sensitive,
     returning the number of octets which would be written to the
     file-stream.  (thanks to Robert J. Macomber)
+  * bug fix: the SB-SIMPLE-STREAMS contrib passes external-format
+    arguments to the internal stream functions.  (thanks to David
+    Lichteblau)
   * optimization: improved type inference for arithmetic-for
     index variables in LOOP
   * optimization: faster floating-point SQRT on x86-64
index ad29bbc..237cb93 100644 (file)
@@ -72,7 +72,7 @@ TODO (rudi 2003-05-19): make the above work, make (defknown open) use it.
                                              :rename-and-delete :overwrite
                                              :append :supersede nil))
                          (:if-does-not-exist (member :error :create nil))
-                         (:external-format (member :default))
+                         (:external-format keyword)
                          (:class (or symbol class))
                          (:mapped (member t nil))
                          (:input-handle (or null fixnum stream))
index dacfb86..8b32d9e 100644 (file)
            (type (member :input :output :io :probe) direction)
            (type (member :error :new-version :rename :rename-and-delete
                          :overwrite :append :supersede nil) if-exists)
-           (type (member :error :create nil) if-does-not-exist)
-           (ignore external-format))
+           (type (member :error :create nil) if-does-not-exist))
   (let ((filespec (merge-pathnames pathname)))
     (multiple-value-bind (fd namestring original delete-original)
         (%fd-open filespec direction if-exists if-exists-given
                                   :pathname pathname
                                   :dual-channel-p nil
                                   :input-buffer-p t
-                                  :auto-close t))
+                                  :auto-close t
+                                  :external-format external-format))
           (:probe
            (let ((stream (sb-impl::%make-fd-stream :name namestring :fd fd
                                                    :pathname pathname
index 0577d03..557fb63 100644 (file)
@@ -908,3 +908,19 @@ Nothing to see here, move along.")
 (deftest string-simple-stream-1
     (values (subtypep 'string-simple-stream 'string-stream))
   T)
+
+;; don't break fd-stream external-format support:
+
+(deftest external-format-1
+    (progn
+      (with-open-file (s *test-file*
+                       :direction :output
+                       :if-exists :supersede
+                       :element-type '(unsigned-byte 8))
+        (write-byte 195 s)
+        (write-byte 132 s))
+      (with-open-file (s *test-file*
+                       :direction :input
+                       :external-format :utf-8)
+        (char-code (read-char s))))
+  196)
index ec2a5be..5907599 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.7.18"
+"0.9.7.19"