Skip to content
Snippets Groups Projects
Commit 738677bf authored by rtoy's avatar rtoy
Browse files

WITH-INPUT-FROM-STRING should not modify the index if it does not exit

normally.
parent 54caaf43
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.105 2005/07/13 14:46:34 rtoy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/macros.lisp,v 1.106 2005/10/21 13:13:33 rtoy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1592,9 +1592,11 @@ ...@@ -1592,9 +1592,11 @@
`(make-string-input-stream ,string ,(or start 0) ,end))))) `(make-string-input-stream ,string ,(or start 0) ,end)))))
,@decls ,@decls
(unwind-protect (unwind-protect
(progn ,@forms) (multiple-value-prog1
(close ,var) (progn ,@forms)
,@(if index `((setf ,index (string-input-stream-current ,var)))))))) ,@(when index
`((setf ,index (string-input-stream-current ,var)))))
(close ,var)))))
(defmacro with-output-to-string ((var &optional string &key element-type) (defmacro with-output-to-string ((var &optional string &key element-type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment