X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Finternal.lisp;h=e5e926e68791965c0cb8f6efe370c507980f69cd;hb=1d46d379bb7a6424524b978f213ef69be5f1ad69;hp=154abdc936d12f4944d56e63aed0d3ee0eb19da1;hpb=5ba66265969b795c05206b8677823878582a656d;p=sbcl.git diff --git a/contrib/sb-simple-streams/internal.lisp b/contrib/sb-simple-streams/internal.lisp index 154abdc..e5e926e 100644 --- a/contrib/sb-simple-streams/internal.lisp +++ b/contrib/sb-simple-streams/internal.lisp @@ -83,7 +83,13 @@ (defun std-dc-newline-in-handler (stream character) (with-stream-class (dual-channel-simple-stream stream) - (setf (sm charpos stream) -1) ;; set to 0 "if reading" ??? + ;; FIXME: Currently, -1 is wrong, since callers of CHARPOS expect + ;; a result in (or null (and fixnum unsigned-byte)), so they must + ;; never see this temporary value. Note that in + ;; STD-NEWLINE-OUT-HANDLER it is correct to use -1, since CHARPOS + ;; is incremented to zero before WRITE-CHAR returns. Perhaps the + ;; same should happen for input? + (setf (sm charpos stream) 0) ; was -1 character)) (defvar *std-control-out-table* @@ -467,6 +473,8 @@ (declare (type sb-int:index mask)) (let ((name (cond ((sb-int:unix-namestring pathname input)) ((and input (eq if-does-not-exist :create)) + (sb-int:unix-namestring pathname nil)) + ((and (eq direction :io) (not if-does-not-exist-given)) (sb-int:unix-namestring pathname nil))))) ;; Process if-exists argument if we are doing any output. (cond (output @@ -476,11 +484,11 @@ :new-version :error))) (case if-exists - ((:error nil) + ((:error nil :new-version) (setf mask (logior mask sb-unix:o_excl))) ((:rename :rename-and-delete) (setf mask (logior mask sb-unix:o_creat))) - ((:new-version :supersede) + ((:supersede) (setf mask (logior mask sb-unix:o_trunc))))) (t (setf if-exists nil))) ; :ignore-this-arg