summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/util_str.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index 1ccdf49dc4..e1fa19aa0b 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -663,6 +663,9 @@ char *strrchr_m(const char *s, char c)
return ret;
}
+/*
+ return True if any (multi-byte) character is lower case
+*/
BOOL strhaslower(const char *string)
{
while (*string) {
@@ -673,9 +676,9 @@ BOOL strhaslower(const char *string)
s = next_codepoint(string, &c_size);
string += c_size;
- t = tolower_w(s);
+ t = toupper_w(s);
- if (s == t) { /* the source was alreay lower case */
+ if (s != t) {
return True; /* that means it has lower case chars */
}
}
@@ -683,6 +686,9 @@ BOOL strhaslower(const char *string)
return False;
}
+/*
+ return True if any (multi-byte) character is upper case
+*/
BOOL strhasupper(const char *string)
{
while (*string) {
@@ -693,9 +699,9 @@ BOOL strhasupper(const char *string)
s = next_codepoint(string, &c_size);
string += c_size;
- t = toupper_w(s);
+ t = tolower_w(s);
- if (s == t) { /* the source was alreay upper case */
+ if (s != t) {
return True; /* that means it has upper case chars */
}
}