Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
524a6f8b
Commit
524a6f8b
authored
Jan 10, 2006
by
simonmar
Browse files
[project @ 2006-01-10 14:39:38 by simonmar]
prevChar: don't back up over decoding errors
parent
a85ab68b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/utils/Encoding.hs
View file @
524a6f8b
...
...
@@ -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
)
==
0x
8
0
if
w
>=
0x80
&&
w
<
0x
C
0
then
go
(
p
`
plusPtr
`
(
-
1
))
else
return
p
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment