Skip to content
Snippets Groups Projects
Commit ca3deab2 authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'issue-121-fill-pointer-misc' into 'master'

Fix #121: fill-pointer-misc off by one for charpos

Closes #121

See merge request cmucl/cmucl!83
parents b9315678 bd79fc27
No related branches found
No related tags found
No related merge requests found
......@@ -1928,7 +1928,10 @@ output to Output-stream"
(let ((found (position #\newline string :test #'char=
:end end :from-end t)))
(if found
(- end (the fixnum found))
;; END points to where the next character goes, not the
;; last character. FOUND is where the newline is.
;; Subtract 1 to adjust for the difference.
(- end (the fixnum found) 1)
current)))))
(:element-type 'base-char)))
......
......@@ -48,6 +48,7 @@ public domain.
* ~~#108~~ Update ASDF
* ~~#112~~ CLX can't connect to X server via inet sockets
* ~~#113~~ REQUIRE on contribs can pull in the wrong things vai ASDF.
* ~~#121~~ Wrong column index in FILL-POINTER-OUTPUT-STREAM
* Other changes:
* Improvements to the PCL implementation of CLOS:
* Changes to building procedure:
......
......@@ -556,3 +556,17 @@
(assert-equalp
3.0380154777955097d205
(expt 1.7976931348623157d308 0.6666)))
(define-test issue.121
(:tag :issues)
;; Output should only have one newline character in it. Previously,
;; we printed two.
(assert-equalp
(concatenate 'string "xxx" (string #\Newline))
(let ((a (make-array 0 :element-type 'character :fill-pointer 0
:adjustable t)))
(with-output-to-string (s a)
(format s "xxx")
(terpri s)
(fresh-line s))
a)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment