474 |
476 |
475 int cx_strcasecmp( |
477 int cx_strcasecmp( |
476 cxstring s1, |
478 cxstring s1, |
477 cxstring s2 |
479 cxstring s2 |
478 ) { |
480 ) { |
|
481 #ifdef _WIN32 |
|
482 int r = _strnicmp(s1.ptr, s2.ptr, s1.length); |
|
483 #else |
|
484 int r = strncasecmp(s1.ptr, s2.ptr, s1.length); |
|
485 #endif |
|
486 if (r != 0) return r; |
479 if (s1.length == s2.length) { |
487 if (s1.length == s2.length) { |
480 #ifdef _WIN32 |
488 return 0; |
481 return _strnicmp(s1.ptr, s2.ptr, s1.length); |
|
482 #else |
|
483 return strncasecmp(s1.ptr, s2.ptr, s1.length); |
|
484 #endif |
|
485 } else if (s1.length > s2.length) { |
489 } else if (s1.length > s2.length) { |
486 return 1; |
490 return 1; |
487 } else { |
491 } else { |
488 return -1; |
492 return -1; |
489 } |
493 } |