MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FS_PathCmp

Function FS_PathCmp

code/qcommon/files.cpp:2475–2505  ·  view source on GitHub ↗

=========== FS_PathCmp Ignore case and separator char distinctions =========== */

Source from the content-addressed store, hash-verified

2473===========
2474*/
2475int FS_PathCmp( const char *s1, const char *s2 ) {
2476 int c1, c2;
2477
2478 do {
2479 c1 = *s1++;
2480 c2 = *s2++;
2481
2482 if (c1 >= 'a' && c1 <= 'z') {
2483 c1 -= ('a' - 'A');
2484 }
2485 if (c2 >= 'a' && c2 <= 'z') {
2486 c2 -= ('a' - 'A');
2487 }
2488
2489 if ( c1 == '\\' || c1 == ':' ) {
2490 c1 = '/';
2491 }
2492 if ( c2 == '\\' || c2 == ':' ) {
2493 c2 = '/';
2494 }
2495
2496 if (c1 < c2) {
2497 return -1; // strings not equal
2498 }
2499 if (c1 > c2) {
2500 return 1;
2501 }
2502 } while (c1);
2503
2504 return 0; // strings are equal
2505}
2506
2507/*
2508================

Callers 2

FS_SortFileListFunction · 0.70
paksortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected