Search for multi-byte character C in multi-byte string S. Return a pointer to the character, or NULL if not found. */
| 1390 | /* Search for multi-byte character C in multi-byte string S. |
| 1391 | Return a pointer to the character, or NULL if not found. */ |
| 1392 | ATTRIBUTE_PURE |
| 1393 | static char * |
| 1394 | mbsmbchr (char const *s, char const *c) |
| 1395 | { |
| 1396 | unsigned char uc = *c; |
| 1397 | /* GB18030 is the most restrictive for the 0x30 optimization below. */ |
| 1398 | if (uc < 0x30 || MB_CUR_MAX == 1) |
| 1399 | return (char *) strchr (s, uc); |
| 1400 | else if (is_utf8_charset ()) |
| 1401 | return (char *) (uc < 0x80 ? strchr (s, uc) : strstr (s, c)); |
| 1402 | else |
| 1403 | return *(c + 1) == '\0' ? mbschr (s, uc) : (char *) mbsstr (s, c); |
| 1404 | } |
| 1405 | |
| 1406 | /* Return a pointer to the beginning of the next field in line. |
| 1407 | The line pointer is moved to the end of the next field. */ |
no test coverage detected