From 8eb4473fb596e0c60930f1c1a080f4c6b424005b Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 9 Aug 2004 13:13:53 +0000 Subject: [PATCH] 0.8.13.42: Fix for "~V%" NIL (and countless other similar examples from ansi-tests) --- NEWS | 3 +++ src/code/target-format.lisp | 2 +- tests/print.impure.lisp | 3 +++ version.lisp-expr | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 2ac5f55..0afb90d 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,9 @@ changes in sbcl-0.8.14 relative to sbcl-0.8.13: to approximately the same size (using Euclid's algorithm) before applying the more sophisticated binary GCD. (thanks to Juho Snellman) + * fixed some bugs revealed by Paul Dietz' test suite: + ** format variable parameters ("~V") are defaulted properly + if the corresponding argument is NIL. changes in sbcl-0.8.13 relative to sbcl-0.8.12: * new feature: SB-PACKAGE-LOCKS. See the "Package Locks" section of diff --git a/src/code/target-format.lisp b/src/code/target-format.lisp index 99cbb3f..5e959fd 100644 --- a/src/code/target-format.lisp +++ b/src/code/target-format.lisp @@ -145,7 +145,7 @@ (offset (car param-and-offset)) (param (cdr param-and-offset))) (case param - (:arg (next-arg offset)) + (:arg (or (next-arg offset) ,default)) (:remaining (length args)) ((nil) ,default) (t param))))))) diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 9a3a2c3..4fd0a67 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -239,5 +239,8 @@ (write #2a((t t) (nil nil)) :stream s)))) (assert (equalp (read-from-string output) #2a((t t) (nil nil)))))) +;;; NIL parameters to "interpreted" FORMAT directives +(assert (string= (format nil "~v%" nil) (string #\Newline))) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 1a12e2c..065bba6 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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".) -"0.8.13.41" +"0.8.13.42" -- 1.7.10.4