Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Nov 2018 15:05:47 +0000 (UTC)
From:      Yuri Pankov <yuripv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r341234 - stable/12/contrib/nvi/common
Message-ID:  <201811291505.wATF5lxF083163@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yuripv
Date: Thu Nov 29 15:05:47 2018
New Revision: 341234
URL: https://svnweb.freebsd.org/changeset/base/341234

Log:
  MFC r340976:
  vi: fix UTF-8 detection.
  
  PR:		202290
  Submitted by:	lampa@fit.vutbr.cz
  Reviewed by:	bapt
  Differential Revision:	https://reviews.freebsd.org/D17950

Modified:
  stable/12/contrib/nvi/common/encoding.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/nvi/common/encoding.c
==============================================================================
--- stable/12/contrib/nvi/common/encoding.c	Thu Nov 29 14:49:33 2018	(r341233)
+++ stable/12/contrib/nvi/common/encoding.c	Thu Nov 29 15:05:47 2018	(r341234)
@@ -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?201811291505.wATF5lxF083163>