mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
vi: fix UTF-8 detection.
PR: 202290 Submitted by: [email protected] Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17950
This commit is contained in:
1 parent
6b31818dee
commit
f2dfec1ffb
1 file changed
+1
-1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340976
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user