summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/IO
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-11-24 16:42:21 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-11-24 16:42:21 +0000
commit443a9f1bca9897dca89ed33fb6b8cb3a2414136b (patch)
tree0ca34a70d18b86692c5fd18e909e58a0a5a2c185 /libraries/base/GHC/IO
parent3beebdccb67585c2f229da92eaab6822c6ebbc64 (diff)
downloadhaskell-443a9f1bca9897dca89ed33fb6b8cb3a2414136b.tar.gz
Don't throw an error if the output buffer had no room
This is consistent with the other codecs, and will be relied on by some upcoming changes in the IO library.
Diffstat (limited to 'libraries/base/GHC/IO')
-rw-r--r--libraries/base/GHC/IO/Encoding/Iconv.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/base/GHC/IO/Encoding/Iconv.hs b/libraries/base/GHC/IO/Encoding/Iconv.hs
index 1c19b00cf4..faf58e9860 100644
--- a/libraries/base/GHC/IO/Encoding/Iconv.hs
+++ b/libraries/base/GHC/IO/Encoding/Iconv.hs
@@ -194,11 +194,10 @@ iconvRecode iconv_t
else do
errno <- getErrno
case errno of
- e | e == eINVAL
- || (e == e2BIG || e == eILSEQ) && new_inleft' /= (iw-ir) -> do
+ e | e == eINVAL || e == e2BIG
+ || e == eILSEQ && new_inleft' /= (iw-ir) -> do
iconv_trace ("iconv ignoring error: " ++ show (errnoToIOError "iconv" e Nothing Nothing))
- -- Output overflow is relatively harmless, unless
- -- we made no progress at all.
+ -- Output overflow is harmless
--
-- Similarly, we ignore EILSEQ unless we converted no
-- characters. Sometimes iconv reports EILSEQ for a
@@ -211,8 +210,9 @@ iconvRecode iconv_t
-- the buffer have been drained.
return (new_input, new_output)
- _other ->
- throwErrno "iconvRecoder"
+ e -> do
+ iconv_trace ("iconv returned error: " ++ show (errnoToIOError "iconv" e Nothing Nothing))
+ throwErrno "iconvRecoder"
-- illegal sequence, or some other error
#endif /* !mingw32_HOST_OS */