]> arthur.barton.de Git - netatalk.git/commitdiff
filename should be compared using lower case.
authorHAT <hat@fa2.so-net.ne.jp>
Mon, 2 Jan 2012 02:37:54 +0000 (11:37 +0900)
committerHAT <hat@fa2.so-net.ne.jp>
Mon, 2 Jan 2012 02:37:54 +0000 (11:37 +0900)
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

index f878c8c08015e685974b081d4b199e84e3a73d71..decd8c0a5019980274e81404200f2de0573c0bb9 100644 (file)
@@ -180,8 +180,7 @@ wide & sp strcasechr()
 ucs2_t *strcasechr_w(const ucs2_t *s, ucs2_t c)
 {
        while (*s != 0) {
 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;
                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 (*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++;
        }
 
                s++;
        }