vi: fix UTF-8 detection.
PR: 202290 Submitted by: lampa@fit.vutbr.cz Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17950
This commit is contained in:
parent
6b31818dee
commit
f2dfec1ffb
@ -96,7 +96,7 @@ looks_utf8(const char *ibuf, size_t nbytes)
|
||||
if (i >= nbytes)
|
||||
goto done;
|
||||
|
||||
if (buf[i] & 0x40) /* 10xxxxxx */
|
||||
if ((buf[i] & 0xc0) != 0x80) /* 10xxxxxx */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user