Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check for being in the middle of a codepoint when at end-of-stream (fixes #130) #131

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

daniels220
Copy link
Contributor

If we #position: a character readStream and the argument corresponds to end-of-stream, we don't want to try to read off the end of the stream--but we can be sure that we're not in the middle of a (valid) codepoint, regardless.

I suppose we could be in the middle of an invalid codepoint, if the stream cuts off in the middle of one. For my use-case I'm not concerned about that, as I would never have gotten that far in the first place without an error. I also think if you had an incomplete codepoint in the middle of a stream, positioning the stream immediately after it wouldn't skip backwards or complain—so essentially I'm treating end-of-stream as an initial byte, and otherwise the behavior is the same as elsewhere.

…eam (fixes svenvc#130)

If we #position: a character readStream and the argument corresponds to end-of-stream, we don't want to try to read off the end of the stream--but we can be sure that we're not in the middle of a (valid) codepoint, regardless.
@svenvc svenvc merged commit 580eb63 into svenvc:master Dec 16, 2023
5 checks passed
@svenvc
Copy link
Owner

svenvc commented Dec 16, 2023

Thank you for your contribution !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants