MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / strnscmp

Function strnscmp

extern/btyacc/mstring.c:75–90  ·  view source on GitHub ↗

compare two strings, ignoring whitespace, except between two letters or ** digits (and treat all of these as equal) */

Source from the content-addressed store, hash-verified

73/* compare two strings, ignoring whitespace, except between two letters or
74** digits (and treat all of these as equal) */
75int strnscmp(const char *a, const char *b)
76{
77 while(1) {
78 while (isspace(*a)) a++;
79 while (isspace(*b)) b++;
80 while (*a && *a == *b) a++,b++;
81 if (isspace(*a)) {
82 if (isalnum(a[-1]) && isalnum(*b))
83 break; }
84 else if (isspace(*b)) {
85 if (isalnum(b[-1]) && isalnum(*a))
86 break; }
87 else
88 break; }
89 return *a - *b;
90}
91
92unsigned int strnshash(const char *s)
93{

Callers 1

lookup_arg_cacheFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected