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

Function scompare

src/yvalve/user_dsql.cpp:1299–1327  ·  view source on GitHub ↗

CVC: It seems I've read at least three versions of this routine.

Source from the content-addressed store, hash-verified

1297
1298// CVC: It seems I've read at least three versions of this routine.
1299static bool scompare(const SCHAR* string1, USHORT length1, const SCHAR* string2, USHORT length2)
1300{
1301/**************************************
1302 *
1303 * s c o m p a r e
1304 *
1305 **************************************
1306 *
1307 * Functional description
1308 * Compare two strings case insensitive according to the C locale rules.
1309 *
1310 **************************************/
1311
1312 if (length1 != length2) {
1313 return false;
1314 }
1315
1316 while (length1--)
1317 {
1318 const SCHAR c1 = *string1++;
1319 const SCHAR c2 = *string2++;
1320 if (c1 != c2 && UPPER7(c1) != UPPER7(c2))
1321 {
1322 return false;
1323 }
1324 }
1325
1326 return true;
1327}

Callers 1

lookup_nameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected