summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util/charset/charset.h1
-rw-r--r--lib/util/charset/util_unistr_w.c11
-rw-r--r--source3/lib/charcnv.c2
-rw-r--r--source3/lib/ms_fnmatch.c2
4 files changed, 14 insertions, 2 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 08bb4533d22..ce297d0ddd7 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -257,6 +257,7 @@ int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b);
int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len);
int strcmp_wa(const smb_ucs2_t *a, const char *b);
+smb_ucs2_t toupper_w(smb_ucs2_t v);
/*
* Define stub for charset module which implements 8-bit encoding with gaps.
diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c
index fc6d3747bd2..7e0ece383f2 100644
--- a/lib/util/charset/util_unistr_w.c
+++ b/lib/util/charset/util_unistr_w.c
@@ -252,3 +252,14 @@ int strcmp_wa(const smb_ucs2_t *a, const char *b)
}
return (*(COPY_UCS2_CHAR(&cp,a)) - UCS2_CHAR(*b));
}
+
+smb_ucs2_t toupper_w(smb_ucs2_t v)
+{
+ smb_ucs2_t ret;
+ /* LE to native. */
+ codepoint_t cp = SVAL(&v,0);
+ cp = toupper_m(cp);
+ /* native to LE. */
+ SSVAL(&ret,0,cp);
+ return ret;
+}
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 17e836dfe0f..7d7058cbb04 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -287,7 +287,7 @@ static size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_
terminated if STR_TERMINATE isn't set. */
for (i = 0; i < (ret / 2) && i < (dest_len / 2) && dest_ucs2[i]; i++) {
- smb_ucs2_t v = toupper_m(dest_ucs2[i]);
+ smb_ucs2_t v = toupper_w(dest_ucs2[i]);
if (v != dest_ucs2[i]) {
dest_ucs2[i] = v;
}
diff --git a/source3/lib/ms_fnmatch.c b/source3/lib/ms_fnmatch.c
index f02354bfd7d..e32d094a6b2 100644
--- a/source3/lib/ms_fnmatch.c
+++ b/source3/lib/ms_fnmatch.c
@@ -129,7 +129,7 @@ static int ms_fnmatch_core(const smb_ucs2_t *p, const smb_ucs2_t *n,
if (is_case_sensitive) {
return -1;
}
- if (toupper_m(c) != toupper_m(*n)) {
+ if (toupper_w(c) != toupper_w(*n)) {
return -1;
}
}