| 399 | } |
| 400 | |
| 401 | static int regexec_supports_multi_byte_chars(void) |
| 402 | { |
| 403 | static const char not_space[] = "[^[:space:]]"; |
| 404 | static const char utf8_multi_byte_char[] = "\xc2\xa3"; |
| 405 | regex_t re; |
| 406 | regmatch_t match; |
| 407 | static int result = -1; |
| 408 | |
| 409 | if (result != -1) |
| 410 | return result; |
| 411 | if (regcomp(&re, not_space, REG_EXTENDED)) |
| 412 | BUG("invalid regular expression: %s", not_space); |
| 413 | result = !regexec(&re, utf8_multi_byte_char, 1, &match, 0) && |
| 414 | match.rm_so == 0 && |
| 415 | match.rm_eo == strlen(utf8_multi_byte_char); |
| 416 | regfree(&re); |
| 417 | return result; |
| 418 | } |
| 419 | |
| 420 | static struct userdiff_driver *userdiff_find_by_namelen(const char *name, size_t len) |
| 421 | { |
no test coverage detected