Written by Jack Handy: jakkhandy@hotmail.com
| 29 | |
| 30 | // Written by Jack Handy: jakkhandy@hotmail.com |
| 31 | int wildcmp(const char *wild, const char *str) |
| 32 | { |
| 33 | const char *cp = NULL, *mp = NULL; |
| 34 | |
| 35 | while (*str && *wild != '*') { |
| 36 | if (*wild != *str && *wild != '?') |
| 37 | return 0; |
| 38 | ++wild; |
| 39 | ++str; |
| 40 | } |
| 41 | |
| 42 | while (*str) { |
| 43 | if (*wild == '*') { |
| 44 | if (!*++wild) |
| 45 | return 1; |
| 46 | mp = wild; |
| 47 | cp = str + 1; |
| 48 | } else if (*wild == *str || *wild == '?') { |
| 49 | ++wild; |
| 50 | ++str; |
| 51 | } else { |
| 52 | wild = mp; |
| 53 | str = cp++; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | while (*wild == '*') |
| 58 | ++wild; |
| 59 | |
| 60 | return !*wild; |
| 61 | } |
| 62 | |
| 63 | int strncasecmp(const char *str1, const char *str2, u32 len) |
| 64 | { |
no outgoing calls
no test coverage detected