1.0.29.8: :PTY and stream arguments in RUN-PROGRAM
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 15 Jun 2009 11:05:41 +0000 (11:05 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 15 Jun 2009 11:05:41 +0000 (11:05 +0000)
 * Reported by Elliot Slaughter, patch by Stas Boukarev.

NEWS
src/code/run-program.lisp
tests/run-program.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 9218928..529fca2 100644 (file)
--- a/NEWS
+++ b/NEWS
     from lists (eg. ADJOIN) are compiled with both :TEST and :TEST-NOT.
     (reported by Tobias Rittweiler)
   * bug fix: regression in DIRECTORY from 1.0.28.61, pattern matching of
-    directory components now works again.
+    directory components now works again. (reported by Michael Becker and
+    Gabriel Dos Reis)
+  * bug fix: :PTY option in RUN-PROGRAM was broken with stream arguments.
+    (reported by Elliot Slaughter, thanks to Stas Boukarev)
 
 changes in sbcl-1.0.29 relative to 1.0.28:
   * IMPORTANT: bug database has moved from the BUGS file to Launchpad
index dbb16cc..1b9b310 100644 (file)
@@ -440,7 +440,7 @@ status slot."
             (error "could not find a pty"))))))
 
 #-win32
-(defun open-pty (pty cookie)
+(defun open-pty (pty cookie &key (external-format :default))
   (when pty
     (multiple-value-bind
           (master slave name)
@@ -452,7 +452,7 @@ status slot."
           (unless new-fd
             (error "couldn't SB-UNIX:UNIX-DUP ~W: ~A" master (strerror errno)))
           (push new-fd *close-on-error*)
-          (copy-descriptor-to-stream new-fd pty cookie)))
+          (copy-descriptor-to-stream new-fd pty cookie external-format)))
       (values name
               (sb-sys:make-fd-stream master :input t :output t
                                      :element-type :default
index 9ef07e5..01100ba 100644 (file)
               (sb-ext:run-program "/bin/echo" '
                                   ("It would be nice if this didn't crash.")
                                   :wait nil :output nil)))))
+
+(with-test (:name (:run-program :pty-stream))
+  (assert (equal "OK"
+                 (subseq
+                  (with-output-to-string (s)
+                    (assert (= 42 (process-exit-code
+                                   (run-program "/bin/sh" '("-c" "echo OK; exit 42") :wait t
+                                                :pty s))))
+                    s)
+                  0
+                  2))))
index be30965..c247df6 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".)
-"1.0.29.7"
+"1.0.29.8"