File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 19
19
This was already the semantics when using ` hOpen ` from the ` ioHasFS ` instance,
20
20
but it was not reflected in the ` allowExisting ` function. `allowExisting
21
21
Readmode` now returns ` MustExist` instead of ` AllowExisting`.
22
+ * Bugfix: ` hGetBufExactly ` and ` hGetBufExactlyAt ` would previously try to read
23
+ too many bytes in the presence of partial reads. These functions now properly
24
+ count the number of remaining bytes that have to be read.
22
25
23
26
## 0.3.0.1 -- 2024-10-02
24
27
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ hGetBufExactly hfs h buf bufOff c = go c bufOff
263
263
go ! remainingCount ! currentBufOff
264
264
| remainingCount == 0 = pure c
265
265
| otherwise = do
266
- readBytes <- hGetBufSome hfs h buf currentBufOff c
266
+ readBytes <- hGetBufSome hfs h buf currentBufOff remainingCount
267
267
if readBytes == 0 then
268
268
throwIO FsError {
269
269
fsErrorType = FsReachedEOF
@@ -294,7 +294,7 @@ hGetBufExactlyAt hfs h buf bufOff c off = go c off bufOff
294
294
go ! remainingCount ! currentOffset ! currentBufOff
295
295
| remainingCount == 0 = pure c
296
296
| otherwise = do
297
- readBytes <- hGetBufSomeAt hfs h buf currentBufOff c currentOffset
297
+ readBytes <- hGetBufSomeAt hfs h buf currentBufOff remainingCount currentOffset
298
298
if readBytes == 0 then
299
299
throwIO FsError {
300
300
fsErrorType = FsReachedEOF
You can’t perform that action at this time.
0 commit comments