summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--source/include/proto.h3
-rw-r--r--source/lib/kanji.c16
2 files changed, 16 insertions, 3 deletions
diff --git a/source/include/proto.h b/source/include/proto.h
index ca37799bd72..e6a0b1efd74 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -756,9 +756,6 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
char *Strstr(char *s, char *p);
time_t Mktime(struct tm *t);
int InNetGr(char *group,char *host,char *user,char *dom);
-void *malloc_wrapped(int size,char *file,int line);
-void *realloc_wrapped(void *ptr,int size,char *file,int line);
-void free_wrapped(void *ptr,char *file,int line);
void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
/*The following definitions come from reply.c */
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;
+ }
}
/*******************************************************************