summaryrefslogtreecommitdiff
path: root/source3/lib/charcnv.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-09-11 20:17:32 +0000
committerJeremy Allison <jra@samba.org>1997-09-11 20:17:32 +0000
commit30416c0b8a0f54f6cc1179c2e00860eaf5f58401 (patch)
tree09137fd9f782aaf0df42e59aff10953ed95bed32 /source3/lib/charcnv.c
parent77df5c87c69ea7f929df211c41da522248d73cfc (diff)
downloadsamba-30416c0b8a0f54f6cc1179c2e00860eaf5f58401.tar.gz
samba-30416c0b8a0f54f6cc1179c2e00860eaf5f58401.tar.bz2
samba-30416c0b8a0f54f6cc1179c2e00860eaf5f58401.zip
charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c
mangle.c smb.h util.c: Big merge to allow KANJI support to be in the main binary without explicitly compiling with it. locking.c: Fix for smbstatus not being able to read files. namepacket.c: Removed unneccesary debug statement. trans2.c: Added Luke's proposed fix (ifdefed out until further testing). nmblookup.c: Fixed bug where query fails and status is done on bogus IP. Jeremy (jallison@whistle.com) (This used to be commit 9196255022ae8c51b527412747b324819bea2c13)
Diffstat (limited to 'source3/lib/charcnv.c')
-rw-r--r--source3/lib/charcnv.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 6be455c47b..a7dff4224b 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -107,13 +107,18 @@ char *unix2dos_format(char *str,BOOL overwrite)
char *dp;
if (!mapsinited) initmaps();
- if (overwrite) {
- for (p = str; *p; p++) *p = unix2dos[(unsigned char)*p];
- return str;
- } else {
- for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = unix2dos[(unsigned char)*p];
- *dp = 0;
- return cvtbuf;
+
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ return (*_unix_to_dos)(str, overwrite);
+ else {
+ if (overwrite) {
+ for (p = str; *p; p++) *p = unix2dos[(unsigned char)*p];
+ return str;
+ } else {
+ for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = unix2dos[(unsigned char)*p];
+ *dp = 0;
+ return cvtbuf;
+ }
}
}
@@ -126,13 +131,18 @@ char *dos2unix_format(char *str, BOOL overwrite)
char *dp;
if (!mapsinited) initmaps();
- if (overwrite) {
- for (p = str; *p; p++) *p = dos2unix[(unsigned char)*p];
- return str;
- } else {
- for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = dos2unix[(unsigned char)*p];
- *dp = 0;
- return cvtbuf;
+
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ return (*_dos_to_unix)(str, overwrite);
+ else {
+ if (overwrite) {
+ for (p = str; *p; p++) *p = dos2unix[(unsigned char)*p];
+ return str;
+ } else {
+ for (p = str, dp = cvtbuf; *p; p++,dp++) *dp = dos2unix[(unsigned char)*p];
+ *dp = 0;
+ return cvtbuf;
+ }
}
}