From owner-svn-src-all@freebsd.org Mon Nov 26 15:33:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC0E41139EB1; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EFB579080; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F9275E48; Mon, 26 Nov 2018 15:33:56 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAQFXuNS055424; Mon, 26 Nov 2018 15:33:56 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAQFXu3W055423; Mon, 26 Nov 2018 15:33:56 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201811261533.wAQFXu3W055423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Mon, 26 Nov 2018 15:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340976 - head/contrib/nvi/common X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/contrib/nvi/common X-SVN-Commit-Revision: 340976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EFB579080 X-Spamd-Result: default: False [1.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.08)[-0.084,0]; NEURAL_SPAM_LONG(0.64)[0.643,0]; NEURAL_SPAM_MEDIUM(0.56)[0.562,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 15:33:57 -0000 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; }