Ticket #5843: getsome.patch

File getsome.patch, 581 bytes (added by pcapriotti, 2 years ago)
  • GHC/IO/Handle/Text.hs

    diff --git a/GHC/IO/Handle/Text.hs b/GHC/IO/Handle/Text.hs
    index 280cebd..3eedae6 100644
    a b hGetBufSome h ptr count 
    889889                                        -- that bufReadNBNonEmpty will not 
    890890                                        -- issue another read. 
    891891            else 
    892               bufReadNBNonEmpty h_ buf (castPtr ptr) 0 count 
     892              let count' = min count (bufferElems buf) 
     893              in bufReadNBNonEmpty h_ buf (castPtr ptr) 0 count' 
    893894 
    894895haFD :: Handle__ -> FD 
    895896haFD h_@Handle__{..} =