From: HAT Date: Mon, 2 Jan 2012 02:37:54 +0000 (+0900) Subject: filename should be compared using lower case. X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=bf00805586b8c539e9341a17537543bd218cc5c1 filename should be compared using lower case. 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. --- diff --git a/libatalk/unicode/util_unistr.c b/libatalk/unicode/util_unistr.c index f878c8c0..decd8c0a 100644 --- a/libatalk/unicode/util_unistr.c +++ b/libatalk/unicode/util_unistr.c @@ -180,8 +180,7 @@ wide & sp strcasechr() 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; @@ -193,7 +192,7 @@ ucs2_t *strcasechr_sp(const ucs2_t *s, u_int32_t c_sp) { 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++; }