summaryrefslogtreecommitdiff
path: root/source/lib/util.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-07-02 22:37:44 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-07-02 22:37:44 +0000
commit1f0ecfe4fc612b214480f8b8462764964556ed5c (patch)
tree9481733300399257e2c89406838795bf9172534e /source/lib/util.c
parent93352e1aae9a1af7036cf56da820356cefe3698b (diff)
downloadsamba-1f0ecfe4fc612b214480f8b8462764964556ed5c.tar.gz
Fixed wierd bug with lowercase accented character directories.
Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/lib/util.c')
-rw-r--r--source/lib/util.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 9ebfdca88ea..b9b647395b9 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -800,12 +800,15 @@ char *attrib_string(int mode)
int StrCaseCmp(const char *s, const char *t)
{
/* compare until we run out of string, either t or s, or find a difference */
- while (*s && *t && tolower(*s) == tolower(*t))
+ /* We *must* use toupper rather than tolower here due to the
+ asynchronous upper to lower mapping.
+ */
+ while (*s && *t && toupper(*s) == toupper(*t))
{
s++; t++;
}
- return(tolower(*s) - tolower(*t));
+ return(toupper(*s) - toupper(*t));
}
/*******************************************************************
@@ -814,13 +817,16 @@ int StrCaseCmp(const char *s, const char *t)
int StrnCaseCmp(const char *s, const char *t, int n)
{
/* compare until we run out of string, either t or s, or chars */
- while (n-- && *s && *t && tolower(*s) == tolower(*t))
+ /* We *must* use toupper rather than tolower here due to the
+ asynchronous upper to lower mapping.
+ */
+ while (n-- && *s && *t && toupper(*s) == toupper(*t))
{
s++; t++;
}
/* not run out of chars - strings are different lengths */
- if (n) return(tolower(*s) - tolower(*t));
+ if (n) return(toupper(*s) - toupper(*t));
/* identical up to where we run out of chars, and strings are same length */
return(0);