This function is used throughout the OpenBSD tree and I think it's
fine as it is. This way it's clearer to me that it's about byte
7 and 8 and not have to do the math in my head to check if we
might have botched it.

Also compilers should be smart enough to optimize this out at
compile-time anyway.

martijn@

On Sat, 2020-07-25 at 17:40 +0100, ropers wrote:
> Index: emacs.c
> ===================================================================
> RCS file: /cvs/src/bin/ksh/emacs.c,v
> retrieving revision 1.87
> diff -u -r1.87 emacs.c
> --- emacs.c   8 May 2020 14:30:42 -0000       1.87
> +++ emacs.c   25 Jul 2020 16:31:22 -0000
> @@ -269,10 +269,11 @@
>       { 0, 0, 0 },
>  };
> 
> +/* is octet a UTF-8 continuation byte? */
>  int
>  isu8cont(unsigned char c)
>  {
> -     return (c & (0x80 | 0x40)) == 0x80;
> +     return (c & 0xC0) == 0x80;
>  }
> 
>  int
> 

Reply via email to