summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-05-19 20:08:37 +0000
committerJeremy Allison <jra@samba.org>1998-05-19 20:08:37 +0000
commit1b412a501e22602ac5edcd875e09bd3814b6e841 (patch)
treeec79a2f52899bb583bdcb322444ea6e1f2fc5be9 /source3/lib/util.c
parent73231a9e636bcb8d74000d5529a3c513d6c27ea3 (diff)
downloadsamba-1b412a501e22602ac5edcd875e09bd3814b6e841.tar.gz
samba-1b412a501e22602ac5edcd875e09bd3814b6e841.tar.bz2
samba-1b412a501e22602ac5edcd875e09bd3814b6e841.zip
passdb.c: Fixed typo in coment.
smb.h: Removed comments no longer valid. smbpass.c: Stopped dummy function from being prototyped. util.c: Fix for multibyte char problems with strlower, strupper and string_replace. Jeremy. (This used to be commit cd244b45a5d35fceee2a4034b0c6aabdb58871aa)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c53
1 files changed, 22 insertions, 31 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 4c8133cabf..75c3de541f 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1115,9 +1115,15 @@ void strlower(char *s)
else
#endif /* KANJI_WIN95_COMPATIBILITY */
{
- if (isupper(*s))
- *s = tolower(*s);
- s++;
+ int skip = skip_multibyte_char( *s );
+ if( skip != 0 )
+ s += skip;
+ else
+ {
+ if (isupper(*s))
+ *s = tolower(*s);
+ s++;
+ }
}
}
}
@@ -1162,9 +1168,15 @@ void strupper(char *s)
else
#endif /* KANJI_WIN95_COMPATIBILITY */
{
- if (islower(*s))
- *s = toupper(*s);
- s++;
+ int skip = skip_multibyte_char( *s );
+ if( skip != 0 )
+ s += skip;
+ else
+ {
+ if (islower(*s))
+ *s = toupper(*s);
+ s++;
+ }
}
}
}
@@ -1197,34 +1209,13 @@ BOOL strisnormal(char *s)
****************************************************************************/
void string_replace(char *s,char oldc,char newc)
{
+ int skip;
while (*s)
{
-#if !defined(KANJI_WIN95_COMPATIBILITY)
- /*
- * For completeness we should put in equivalent code for code pages
- * 949 (Korean hangul) and 950 (Big5 Traditional Chinese) here - but
- * doubt anyone wants Samba to behave differently from Win95 and WinNT
- * here. They both treat full width ascii characters as case senstive
- * filenames (ie. they don't do the work we do here).
- * JRA.
- */
-
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- /* Win95 treats full width ascii characters as case sensitive. */
- if (is_shift_jis (*s))
- s += 2;
- else if (is_kana (*s))
- s++;
- else
- {
- if (oldc == *s)
- *s = newc;
- s++;
- }
- }
+ skip = skip_multibyte_char( *s );
+ if( skip != 0 )
+ s += skip;
else
-#endif /* KANJI_WIN95_COMPATIBILITY */
{
if (oldc == *s)
*s = newc;