From 27c5b1f2f56e5610e46f0f669cf2eb1498da1718 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 29 Nov 2004 16:49:24 +0000 Subject: [PATCH] FORMAT returns NIL when stream argument is not nil (M.Goffioul) --- src/c/format.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/c/format.d b/src/c/format.d index 7d5870598..31f94c25c 100644 --- a/src/c/format.d +++ b/src/c/format.d @@ -2046,9 +2046,11 @@ DIRECTIVE: @(defun format (strm string &rest args) cl_object output = Cnil; + int null_strm = 0; @ if (Null(strm)) { strm = cl_alloc_adjustable_string(64); + null_strm = 1; } else if (strm == Ct) { strm = symbol_value(@'*standard-output*'); } @@ -2064,6 +2066,8 @@ DIRECTIVE: } strm = make_string_output_stream(0); strm->stream.object0 = output; + if (null_strm == 0) + output = Cnil; } if (!Null(cl_functionp(string))) { cl_apply(3, string, strm, cl_grab_rest_args(args));