hWaitForInput: don't try to read from the device (#4078)
[ghc-base.git] / GHC / IO / Handle / Text.hs
index b0f3a24..23b9cdd 100644 (file)
@@ -95,7 +95,7 @@ hWaitForInput h msecs = do
                 return True
         else do
                -- there might be bytes in the byte buffer waiting to be decoded
-               cbuf' <- readTextDeviceNonBlocking handle_ cbuf
+               cbuf' <- decodeByteBuf handle_ cbuf
                writeIORef haCharBuffer cbuf'
 
                if not (isEmptyBuffer cbuf') then return True else do