MCPcopy Create free account
hub / github.com/ZDoom/Raze / CheckWildcards

Function CheckWildcards

source/common/utility/cmdlib.cpp:411–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409//==========================================================================
410
411bool 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//

Callers 3

DumpHashFunction · 0.85
ListVarsMethod · 0.85
ListActionCommandsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected