svn commit: r340976 - head/contrib/nvi/common
Yuri Pankov
yuripv at FreeBSD.org
Mon Nov 26 15:33:57 UTC 2018
Author: yuripv
Date: Mon Nov 26 15:33:55 2018
New Revision: 340976
URL: https://svnweb.freebsd.org/changeset/base/340976
Log:
vi: fix UTF-8 detection.
PR: 202290
Submitted by: lampa at fit.vutbr.cz
Reviewed by: bapt
Approved by: kib (mentor, implicit)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17950
Modified:
head/contrib/nvi/common/encoding.c
Modified: head/contrib/nvi/common/encoding.c
==============================================================================
--- head/contrib/nvi/common/encoding.c Mon Nov 26 15:12:58 2018 (r340975)
+++ head/contrib/nvi/common/encoding.c Mon Nov 26 15:33:55 2018 (r340976)
@@ -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;
}
More information about the svn-src-all
mailing list