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
d56e28cc
Commit
d56e28cc
authored
21 years ago
by
gerd
Browse files
Options
Downloads
Patches
Plain Diff
* src/code/fd-stream.lisp (fd-stream-read-n-bytes): Take unread
into account.
parent
15347333
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
+15
-1
15 additions, 1 deletion
code/fd-stream.lisp
with
15 additions
and
1 deletion
code/fd-stream.lisp
+
15
−
1
View file @
d56e28cc
...
...
@@ -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.7
1
2003/08/
05 11:00:49 emarsden
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.7
2
2003/08/
19 09:26:57 gerd
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -726,6 +726,20 @@
(
available
(
-
tail
head
))
(
copy
(
min
requested
available
)))
(
declare
(
type
index
offset
head
tail
available
copy
))
;;
;; If something has been unread, put that at buffer + start,
;; and read the rest to start + 1.
(
when
(
fd-stream-unread
stream
)
(
etypecase
buffer
(
system-area-pointer
(
assert
(
=
1
(
fd-stream-element-size
stream
)))
(
setf
(
sap-ref-8
buffer
start
)
(
char-code
(
read-char
stream
))))
(
vector
(
setf
(
aref
buffer
start
)
(
read-char
stream
))))
(
return-from
fd-stream-read-n-bytes
(
1+
(
fd-stream-read-n-bytes
stream
buffer
(
1+
start
)
(
1-
requested
)
eof-error-p
))))
;;
(
unless
(
zerop
copy
)
(
if
(
typep
buffer
'system-area-pointer
)
(
system-area-copy
sap
(
*
head
vm:byte-bits
)
...
...
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