forked from jam1garner/binrw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure
TakeSeek::seek
uses correct stream end position
The purpose of `TakeSeek` is to be a binrw-compatible version of `std::io::Take`, and the purpose of `std::io::Take` is only to truncate the stream to a certain number of bytes, not to extend the stream if a limit beyond the length of the inner stream is given. Thus, `TakeSeek` also needs to pay attention to the true end of the inner stream and use that as the `SeekFrom::End(0)` position if it is less than the limit. Refs jam1garner#291.
- Loading branch information
Showing
2 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters