Fix crashes due to utf8 decoding errors

This commit is contained in:
Julian Ospald 2020-04-08 22:20:26 +02:00
parent 8a0236a350
commit 5382fd9aca
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -43,6 +43,7 @@ import System.Posix.Types
import qualified Control.Exception as EX import qualified Control.Exception as EX
import qualified Data.Text as T import qualified Data.Text as T
import qualified Data.Text.Encoding as E import qualified Data.Text.Encoding as E
import qualified Data.Text.Encoding.Error as E
import qualified System.Posix.Process.ByteString import qualified System.Posix.Process.ByteString
as SPPB as SPPB
import Streamly.External.Posix.DirStream import Streamly.External.Posix.DirStream
@ -202,7 +203,7 @@ execLogged exe spath args lfile chdir env = do
. T.pack . T.pack
. color Blue . color Blue
. T.unpack . T.unpack
. E.decodeUtf8 . E.decodeUtf8With E.lenientDecode
. trim w . trim w
. (\b -> "[ " <> toFilePath lfile <> " ] " <> b) . (\b -> "[ " <> toFilePath lfile <> " ] " <> b)
$ bs $ bs