From 5d371ea82d42cb07c49abbc1b7bfdb773b6fb813 Mon Sep 17 00:00:00 2001 From: malc Date: Sat, 15 Dec 2012 00:01:37 +0400 Subject: [PATCH] Fix leading utf8 byte detection --- main.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.ml b/main.ml index 3f5a039..0011b59 100644 --- a/main.ml +++ b/main.ml @@ -3002,9 +3002,9 @@ let withoutlastutf8 s = then pos else let b = Char.code s.[pos] in - if b land 0b110000 = 0b11000000 - then find (pos-1) - else pos-1 + if b land 0b11000000 = 0b11000000 + then pos + else find (pos-1) in let first = if Char.code s.[len-1] land 0x80 = 0 -- 2.11.4.GIT