Fixes lp#867684.
(if params
(expand-bind-defaults ((count 1)) params
`(progn
- (fresh-line stream)
- (dotimes (i (1- ,count))
- (terpri stream))))
+ (when (plusp ,count)
+ (fresh-line stream)
+ (dotimes (i (1- ,count))
+ (terpri stream)))))
'(fresh-line stream)))
(def-format-directive #\| (colonp atsignp params)
:complaint
"cannot specify either colon or atsign for this directive"))
(interpret-bind-defaults ((count 1)) params
- (fresh-line stream)
- (dotimes (i (1- count))
- (terpri stream))))
+ (when (plusp count)
+ (fresh-line stream)
+ (dotimes (i (1- count))
+ (terpri stream)))))
(def-format-interpreter #\| (colonp atsignp params)
(when (or colonp atsignp)
(assert (equal " 10.00" (format nil "~7,2,2f" 0.1)))
(assert (equal " 0.01" (format nil "~7,2,-2f" 0.5))))
+(with-test (:name :bug-867684)
+ (assert (equal "ab" (format nil "a~0&b"))))
+
;;; success