MCPcopy Create free account
hub / github.com/cppla/ServerStatus / str_comp_filenames

Function str_comp_filenames

server/src/system.c:1673–1702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673int str_comp_filenames(const char *a, const char *b)
1674{
1675 int result;
1676
1677 for(; *a && *b; ++a, ++b)
1678 {
1679 if(*a >= '0' && *a <= '9' && *b >= '0' && *b <= '9')
1680 {
1681 result = 0;
1682 do
1683 {
1684 if(!result)
1685 result = *a - *b;
1686 ++a; ++b;
1687 }
1688 while(*a >= '0' && *a <= '9' && *b >= '0' && *b <= '9');
1689
1690 if(*a >= '0' && *a <= '9')
1691 return 1;
1692 else if(*b >= '0' && *b <= '9')
1693 return -1;
1694 else if(result)
1695 return result;
1696 }
1697
1698 if(tolower(*a) != tolower(*b))
1699 break;
1700 }
1701 return tolower(*a) - tolower(*b);
1702}
1703
1704const char *str_find_nocase(const char *haystack, const char *needle)
1705{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected