summaryrefslogtreecommitdiff
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
commit419e8823e9f67d7b738a676e18595ffb26346b1a (patch)
tree0050005d9fb8ef713681c9d7c797f3dc0f6ec6f9
parent56f87885bceebe4bd89a67a7b5a65c52f99a1708 (diff)
downloadsamba-419e8823e9f67d7b738a676e18595ffb26346b1a.tar.gz
samba-419e8823e9f67d7b738a676e18595ffb26346b1a.tar.bz2
samba-419e8823e9f67d7b738a676e18595ffb26346b1a.zip
kanji.c: Patch from Anders Blomdell <anders.blomdell@control.lth.se>
for problem with kanji sj_strXXX functions. Jeremy. (This used to be commit bf48151e6ddfa72303be7eac9e156046d4fb5b5e)
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/lib/kanji.c16
2 files changed, 16 insertions, 3 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ca37799bd7..e6a0b1efd7 100644
--- a/source3/include/proto.h
+++ b/source3/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/source3/lib/kanji.c b/source3/lib/kanji.c
index 75d1affb20..f6aace8411 100644
--- a/source3/lib/kanji.c
+++ b/source3/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;
+ }
}
/*******************************************************************