1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

pretty-print print-sequence width error

Avoid the "expected a positive width" display error when printing
sequences with no width remaining.

* module/ice-9/pretty-print (print-sequence): test for zero width when
  printing sequences
This commit is contained in:
Mike 2010-11-08 08:52:04 -08:00
parent 289c3a6112
commit bf61ca3302

View file

@ -334,7 +334,7 @@ sub-expression, via the @var{breadth-first?} keyword argument."
(display #\space))
(cond
((= i len)) ; catches 0-length case
((= i (1- len))
((and (= i (1- len)) (or (zero? i) (> width 1)))
(print (ref x i) (if (zero? i) width (1- width))))
((<= width (+ 1 ellipsis-width))
(display "..."))