| 409 | //========================================================================== |
| 410 | |
| 411 | bool CheckWildcards (const char *pattern, const char *text) |
| 412 | { |
| 413 | if (pattern == NULL || text == NULL) |
| 414 | return true; |
| 415 | |
| 416 | while (*pattern) |
| 417 | { |
| 418 | if (*pattern == '*') |
| 419 | { |
| 420 | char stop = tolower (*++pattern); |
| 421 | while (*text && tolower(*text) != stop) |
| 422 | { |
| 423 | text++; |
| 424 | } |
| 425 | if (*text && tolower(*text) == stop) |
| 426 | { |
| 427 | if (CheckWildcards (pattern, text++)) |
| 428 | { |
| 429 | return true; |
| 430 | } |
| 431 | pattern--; |
| 432 | } |
| 433 | } |
| 434 | else if (*pattern == '?' || tolower(*pattern) == tolower(*text)) |
| 435 | { |
| 436 | pattern++; |
| 437 | text++; |
| 438 | } |
| 439 | else |
| 440 | { |
| 441 | return false; |
| 442 | } |
| 443 | } |
| 444 | return (*pattern | *text) == 0; |
| 445 | } |
| 446 | |
| 447 | //========================================================================== |
| 448 | // |
no outgoing calls
no test coverage detected