;;;; -*- coding: utf-8; fill-column: 78 -*-
changes relative to sbcl-1.0.36:
+ * enhancement: *STANDARD-OUTPUT*, *STANDARD-INPUT*, and *ERROR-OUTPUT* are
+ now bivalent.
* bug fix: correct restart text for the continuable error in MAKE-PACKAGE.
changes in sbcl-1.0.37 relative to sbcl-1.0.36:
(when (or (not character-stream-p) bivalent-stream-p)
(multiple-value-setq (bout-routine bout-type bout-size output-bytes
normalized-external-format)
- (pick-output-routine (if bivalent-stream-p
- '(unsigned-byte 8)
- target-type)
- (fd-stream-buffering fd-stream)
- external-format))
+ (let ((buffering (fd-stream-buffering fd-stream)))
+ (if bivalent-stream-p
+ (pick-output-routine '(unsigned-byte 8)
+ (if (eq :line buffering)
+ :full
+ buffering)
+ external-format)
+ (pick-output-routine target-type buffering external-format))))
(unless bout-routine
(error "could not find any output routine for ~S buffered ~S"
(fd-stream-buffering fd-stream)
(with-output-to-string (*error-output*)
(setf *stdin*
(make-fd-stream 0 :name "standard input" :input t :buffering :line
- :external-format (stdstream-external-format nil)))
+ :element-type :default
+ :external-format (stdstream-external-format nil)))
(setf *stdout*
(make-fd-stream 1 :name "standard output" :output t :buffering :line
- :external-format (stdstream-external-format t)))
+ :element-type :default
+ :external-format (stdstream-external-format t)))
(setf *stderr*
(make-fd-stream 2 :name "standard error" :output t :buffering :line
- :external-format (stdstream-external-format t)))
+ :element-type :default
+ :external-format (stdstream-external-format t)))
(let* ((ttyname #.(coerce "/dev/tty" 'simple-base-string))
(tty (sb!unix:unix-open ttyname sb!unix:o_rdwr #o666)))
(if tty
--- /dev/null
+#!/bin/sh
+
+# This software is part of the SBCL system. See the README file for
+# more information.
+#
+# While most of SBCL is derived from the CMU CL system, the test
+# files (like this one) were written from scratch after the fork
+# from CMU CL.
+#
+# This software is in the public domain and is provided with
+# absolutely no warranty. See the COPYING and CREDITS files for
+# more information.
+
+. ./subr.sh
+
+use_test_subdirectory
+
+tmpfilename="$TEST_FILESTEM.lisp"
+
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (if (equal (concatenate 'string "Bivalent *STANDARD-INPUT*" (string #\newline))
+ (with-output-to-string (s)
+ (loop for byte = (read-byte *standard-input* nil)
+ while byte do (write-char (code-char byte) s))))
+ (quit :unix-status $EXIT_LISP_WIN)
+ (quit :unix-status $EXIT_LOSE))
+EOF
+run_sbcl --disable-debugger --load $tmpfilename <<EOF
+Bivalent *STANDARD-INPUT*
+EOF
+check_status_maybe_lose bivalent-standard-input $?
+
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (loop for char across "Bivalent *STANDARD-OUTPUT*"
+ do (write-byte (char-code char) *standard-output*))
+ (terpri *standard-output*)
+ (quit :unix-status $EXIT_LISP_WIN)
+EOF
+run_sbcl --disable-debugger --load $tmpfilename > $tmpfilename.out
+check_status_maybe_lose bivalent-standard-output $?
+test_output=$(cat $tmpfilename.out)
+rm -f $tmpfilename.out
+if [ 'Bivalent *STANDARD-OUTPUT*' != "$test_output" ]; then
+ echo "bad test output: '$test_output'"
+ exit $EXIT_LOSE
+fi
+
+cat > $tmpfilename <<EOF
+ (in-package :cl-user)
+ (loop for char across "Bivalent *ERROR-OUTPUT*"
+ do (write-byte (char-code char) *error-output*))
+ (terpri *error-output*)
+ (quit :unix-status $EXIT_LISP_WIN)
+EOF
+run_sbcl --disable-debugger --load $tmpfilename 2> $tmpfilename.out
+check_status_maybe_lose bivalent-error-output $?
+test_output=$(cat $tmpfilename.out)
+rm -f $tmpfilename.out
+if [ 'Bivalent *ERROR-OUTPUT*' != "$test_output" ]; then
+ echo "bad test output: '$test_output'"
+ exit $EXIT_LOSE
+fi
+
+# success
+exit $EXIT_TEST_WIN