summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-12-11 11:07:09 +0000
committerJeremy Allison <jra@samba.org>1997-12-11 11:07:09 +0000
commitbf48151e6ddfa72303be7eac9e156046d4fb5b5e (patch)
tree96d2bff727fb738dd2fdffbc685c11a91d55f9fa /source/lib
parent2e73fc0449beabc9658b3fe869e577a868af3c0d (diff)
downloadsamba-bf48151e6ddfa72303be7eac9e156046d4fb5b5e.tar.gz
samba-bf48151e6ddfa72303be7eac9e156046d4fb5b5e.tar.xz
samba-bf48151e6ddfa72303be7eac9e156046d4fb5b5e.zip
kanji.c: Patch from Anders Blomdell <anders.blomdell@control.lth.se>
for problem with kanji sj_strXXX functions. Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/kanji.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/lib/kanji.c b/source/lib/kanji.c
index 75d1affb200..f6aace84116 100644
--- a/source/lib/kanji.c
+++ b/source/lib/kanji.c
@@ -41,6 +41,9 @@ static char hex_tag = HEXTAG;
********************************************************************/
char *sj_strtok(char *s1, char *s2)
{
+ if (lp_client_code_page() != KANJI_CODEPAGE) {
+ return strtok(s1, s2);
+ } else {
static char *s = NULL;
char *q;
if (!s1) {
@@ -72,6 +75,7 @@ char *sj_strtok(char *s1, char *s2)
return q;
}
return NULL;
+ }
}
/*******************************************************************
@@ -80,6 +84,9 @@ char *sj_strtok(char *s1, char *s2)
********************************************************************/
char *sj_strstr(char *s1, char *s2)
{
+ if (lp_client_code_page() != KANJI_CODEPAGE) {
+ return strstr(s1, s2);
+ } else {
int len = strlen ((char *) s2);
if (!*s2)
return (char *) s1;
@@ -95,6 +102,7 @@ char *sj_strstr(char *s1, char *s2)
}
}
return 0;
+ }
}
/*******************************************************************
@@ -103,6 +111,9 @@ char *sj_strstr(char *s1, char *s2)
********************************************************************/
char *sj_strchr (char *s, int c)
{
+ if (lp_client_code_page() != KANJI_CODEPAGE) {
+ return strchr(s, c);
+ } else {
for (; *s; ) {
if (*s == c)
return (char *) s;
@@ -113,6 +124,7 @@ char *sj_strchr (char *s, int c)
}
}
return 0;
+ }
}
/*******************************************************************
@@ -121,6 +133,9 @@ char *sj_strchr (char *s, int c)
********************************************************************/
char *sj_strrchr(char *s, int c)
{
+ if (lp_client_code_page() != KANJI_CODEPAGE) {
+ return strrchr(s, c);
+ } else {
char *q;
for (q = 0; *s; ) {
@@ -134,6 +149,7 @@ char *sj_strrchr(char *s, int c)
}
}
return q;
+ }
}
/*******************************************************************