MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_strrncasecmp

Function acl_strrncasecmp

lib_acl/src/stdlib/string/acl_strcasecmp.c:54–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54int acl_strrncasecmp(const char *s1, const char *s2, size_t n)
55{
56 if (n != 0) {
57 const unsigned char *cm = maptolower, *us1, *us2;
58
59 if (*s1 == 0) {
60 if (*s2 == 0)
61 return (0);
62 return (-(*s2));
63 }
64 if (*s2 == 0) {
65 if (*s1 == 0)
66 return (0);
67 return (-(*s1));
68 }
69
70 us1 = (const unsigned char *) s1 + strlen(s1) - 1;
71 us2 = (const unsigned char *) s2 + strlen(s2) - 1;
72
73 do {
74 if (cm[*us1] != cm[*us2])
75 return (cm[*us1] - cm[*us2]);
76 if (us1 == (const unsigned char*) s1) {
77 if (us2 == (const unsigned char*) s2 || n == 1)
78 break;
79 return (-cm[*--us2]);
80 }
81 if (us2 == (const unsigned char*) s2) {
82 if (us1 == (const unsigned char*) s1 || n == 1)
83 break;
84 return (-cm[*--us1]);
85 }
86 us1--;
87 us2--;
88 } while (--n != 0);
89 }
90 return (0);
91}
92
93int acl_strrncmp(const char *s1, const char *s2, size_t n)
94{

Callers 7

ScanSvnCallbackMethod · 0.85
rncompareMethod · 0.85
service_mainFunction · 0.85
scan_pathFunction · 0.85
on_acceptMethod · 0.85
thread_on_acceptMethod · 0.85
http_access_permitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…