summaryrefslogtreecommitdiff
path: root/source3/lib/util_unistr.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-08-12 20:12:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:00:29 -0500
commite4edd9527595faf480b80bf2b2df0392565ea51f (patch)
tree648424ae875c7ec111c530354b3d27291c0378ee /source3/lib/util_unistr.c
parent3bda33caf0ef6ced2a7a87b9082f14dc76631027 (diff)
downloadsamba-e4edd9527595faf480b80bf2b2df0392565ea51f.tar.gz
samba-e4edd9527595faf480b80bf2b2df0392565ea51f.tar.bz2
samba-e4edd9527595faf480b80bf2b2df0392565ea51f.zip
r9271: Fix problems with german umlauts - strcmp_w was broken (needs to always re-call macro
on termination). Fix all other cases where this was also occurring. Jeremy. (This used to be commit 816e2fbb39b544b7f62d5351f3a8e0af63717227)
Diffstat (limited to 'source3/lib/util_unistr.c')
-rw-r--r--source3/lib/util_unistr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 6b29a0d26a..8ed8c5c37f 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -568,7 +568,7 @@ int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b)
a++;
b++;
}
- return cpa - cpb;
+ return (*(COPY_UCS2_CHAR(&cpa,a)) - *(COPY_UCS2_CHAR(&cpb,b)));
/* warning: if *a != *b and both are not 0 we return a random
greater or lesser than 0 number not realted to which
string is longer */
@@ -584,7 +584,7 @@ int strncmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len)
b++;
n++;
}
- return (len - n)?(cpa - cpb):0;
+ return (len - n)?(*(COPY_UCS2_CHAR(&cpa,a)) - *(COPY_UCS2_CHAR(&cpb,b))):0;
}
/*******************************************************************
@@ -599,7 +599,7 @@ int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b)
a++;
b++;
}
- return (tolower_w(cpa) - tolower_w(cpb));
+ return (tolower_w(*(COPY_UCS2_CHAR(&cpa,a))) - tolower_w(*(COPY_UCS2_CHAR(&cpb,b))));
}
/*******************************************************************
@@ -616,7 +616,7 @@ int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len)
b++;
n++;
}
- return (len - n)?(tolower_w(cpa) - tolower_w(cpb)):0;
+ return (len - n)?(tolower_w(*(COPY_UCS2_CHAR(&cpa,a))) - tolower_w(*(COPY_UCS2_CHAR(&cpb,b)))):0;
}
/*******************************************************************