From bf00805586b8c539e9341a17537543bd218cc5c1 Mon Sep 17 00:00:00 2001 From: HAT Date: Mon, 2 Jan 2012 11:37:54 +0900 Subject: [PATCH] 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. --- libatalk/unicode/util_unistr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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++; } -- 2.39.2