Ref: Technical Note TN1150 - HFS Plus Volume Format
http://developer.apple.com/legacy/mac/library/#technotes/tn/tn1150.html#//apple_ref/doc/uid/DTS10002989
BUG: should be compared using NFKD for fuzzy search.
ucs2_t *strcasechr_w(const ucs2_t *s, ucs2_t c)
{
while (*s != 0) {
-/* LOG(log_debug, logtype_default, "Comparing %X to %X (%X - %X)", c, *s, toupper_w(c), toupper_w(*s));*/
- if (toupper_w(c) == toupper_w(*s)) return (ucs2_t *)s;
+ if (tolower_w(c) == tolower_w(*s)) return (ucs2_t *)s;
s++;
}
if (c == *s) return (ucs2_t *)s;
{
if (*s == 0) return NULL;
while (s[1] != 0) {
- if (toupper_sp(c_sp) == toupper_sp((u_int32_t)*s << 16 | (u_int32_t)s[1])) return (ucs2_t *)s;
+ if (tolower_sp(c_sp) == tolower_sp((u_int32_t)*s << 16 | (u_int32_t)s[1])) return (ucs2_t *)s;
s++;
}