summaryrefslogtreecommitdiff
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
commit6b7ca0ddfdc8e983fe867694967607bdbbe38d66 (patch)
tree12d18b426b38b9b4ea4115c142be11c91bf866f7
parent594f8a43610e0407f6842f76c8d80e180e7daed4 (diff)
downloadsamba-6b7ca0ddfdc8e983fe867694967607bdbbe38d66.tar.gz
samba-6b7ca0ddfdc8e983fe867694967607bdbbe38d66.tar.bz2
samba-6b7ca0ddfdc8e983fe867694967607bdbbe38d66.zip
Fixed wierd bug with lowercase accented character directories.
Jeremy (jallison@whistle.com) (This used to be commit 1f0ecfe4fc612b214480f8b8462764964556ed5c)
-rw-r--r--source3/lib/util.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 9ebfdca88e..b9b647395b 100644
--- a/source3/lib/util.c
+++ b/source3/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);