Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
275f6bf1
Commit
275f6bf1
authored
14 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
In EF-FLUSH, we need to handle bare surrogates ourselves for the case
where the external format does not have a flush-state method.
parent
0c3220f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/fd-stream.lisp
+17
-7
17 additions, 7 deletions
code/fd-stream.lisp
with
17 additions
and
7 deletions
code/fd-stream.lisp
+
17
−
7
View file @
275f6bf1
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.10
7
2010/07/03 1
3:39:2
0 rtoy Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.10
8
2010/07/03 1
4:10:4
0 rtoy Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -432,15 +432,25 @@
(
setf
(
fd-stream-obuf-tail
stream
)
tail
)))
(
t
;; No flush-state function, so just output a replacement
;; character. We hack the co-state to what we need for this
;; to work. This should be ok because we're closing the
;; file anyway.
(
let
((
state
(
fd-stream-co-state
stream
)))
(
when
(
and
state
(
car
state
))
;; character (or signal an error). We hack the co-state to
;; what we need for this to work. This should be ok because
;; we're closing the file anyway.
(
let*
((
state
(
fd-stream-co-state
stream
))
(
c
(
car
state
)))
(
when
(
and
state
c
)
(
setf
(
fd-stream-co-state
stream
)
(
cons
nil
(
cdr
state
)))
(
funcall
(
ef-cout
(
fd-stream-external-format
stream
))
stream
(
car
state
))))))
stream
;; Handle bare surrogates or use the
;; replacement character.
(
if
(
lisp::surrogatep
c
)
(
if
(
fd-stream-char-to-octets-error
stream
)
(
funcall
(
fd-stream-char-to-octets-error
stream
)
"Flushing bare surrogate #x~4,0X is illegal"
(
char-code
c
))
(
code-char
stream:+replacement-character-code+
))
c
))))))
(
values
))))
;;; FLUSH-OUTPUT-BUFFER -- internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment