X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FEncoding.hs;fp=ghc%2Fcompiler%2Futils%2FEncoding.hs;h=152bf3c60eb0d56ba74dce577c28e33ed6e6db20;hb=524a6f8bdf35c37998072fc1692c681c45a336f7;hp=7b35e65da44864e729a2efe518477ee204080bb8;hpb=a85ab68b36fcb333ddf92e955049a8d0a91c2c0d;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/Encoding.hs b/ghc/compiler/utils/Encoding.hs index 7b35e65..152bf3c 100644 --- a/ghc/compiler/utils/Encoding.hs +++ b/ghc/compiler/utils/Encoding.hs @@ -105,7 +105,7 @@ utf8PrevChar p = utf8CharStart (p `plusPtr` (-1)) utf8CharStart :: Ptr Word8 -> IO (Ptr Word8) utf8CharStart p = go p where go p = do w <- peek p - if (w .&. 0xC0) == 0x80 + if w >= 0x80 && w < 0xC0 then go (p `plusPtr` (-1)) else return p