We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 545ad29 commit fd9c873Copy full SHA for fd9c873
src/Data/Text/Internal/IO.hs
@@ -112,6 +112,7 @@ unpack !buf !r !w
112
| otherwise = Yield (ix i) (i+1)
113
ix i = inlinePerformIO $ peekElemOff pbuf i
114
115
+-- Variant of 'unpack' with CRLF decoding. If there is a trailing '\r', leave it in the buffer.
116
unpack_nl :: RawCharBuffer -> Int -> Int -> IO (Text, Int)
117
unpack_nl !buf !r !w
118
| charSize /= 4 = sizeError "unpack_nl"
@@ -130,7 +131,7 @@ unpack_nl !buf !r !w
130
131
in if i' < w
132
then if ix i' == '\n'
133
then Yield '\n' (i+2)
- else Yield '\n' i'
134
+ else Yield '\r' i'
135
else Done
136
| otherwise = Yield c (i+1)
137
where c = ix i
0 commit comments