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: la...@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;
                        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to