cut: optimize -d '?' in UTF-8 case

ensure all ascii delims are processed with byte search in UTF-8
This commit is contained in:
Pádraig Brady committed 2026-04-05 13:15:56 +01:00
1 parent f6b3055f74
commit 2a6b36ff5b
1 file changed
+4 -1
+4 -1
View File
@@ -315,8 +315,11 @@ utf8_field_delim_ok (void)
static inline bool
bytesearch_field_delim_ok (void)
{
unsigned char delim_0 = delim_bytes[0];
return (delim_length == 1
? MB_CUR_MAX <= 1 || to_uchar (delim_bytes[0]) < 0x30
? (MB_CUR_MAX <= 1
|| (is_utf8_charset () ? delim_0 < 0x80 : delim_0 < 0x30))
: utf8_field_delim_ok ());
}