Date: Mon, 26 Nov 2018 15:33:56 +0000 (UTC) From: Yuri Pankov <yuripv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340976 - head/contrib/nvi/common Message-ID: <201811261533.wAQFXu3W055423@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811261533.wAQFXu3W055423>