Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2023-01-08 23:26:09 +00:00
3 changed files with 10 additions and 2 deletions

6
utf8.c
View File

@ -230,10 +230,13 @@ utf8_width(struct utf8_data *ud, int *width)
return (UTF8_ERROR);
}
log_debug("UTF-8 %.*s is %08X", (int)ud->size, ud->data, (u_int)wc);
<<<<<<< HEAD
#ifdef HAVE_UTF8PROC
*width = utf8proc_wcwidth(wc);
log_debug("utf8proc_wcwidth(%08X) returned %d", (u_int)wc, *width);
#else
=======
>>>>>>> obsd-master
*width = wcwidth(wc);
log_debug("wcwidth(%08X) returned %d", (u_int)wc, *width);
if (*width < 0) {
@ -243,7 +246,10 @@ utf8_width(struct utf8_data *ud, int *width)
*/
*width = (wc >= 0x80 && wc <= 0x9f) ? 0 : 1;
}
<<<<<<< HEAD
#endif
=======
>>>>>>> obsd-master
if (*width >= 0 && *width <= 0xff)
return (UTF8_DONE);
return (UTF8_ERROR);