summaryrefslogtreecommitdiffstats
path: root/source3/client/clitar.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/client/clitar.c
parent77df5c87c69ea7f929df211c41da522248d73cfc (diff)
downloadsamba-30416c0b8a0f54f6cc1179c2e00860eaf5f58401.tar.gz
samba-30416c0b8a0f54f6cc1179c2e00860eaf5f58401.tar.xz
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/client/clitar.c')
-rw-r--r--source3/client/clitar.c88
1 files changed, 52 insertions, 36 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index d5bca8c5bbb..a30f6c2960f 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -306,27 +306,35 @@ static void fixtarname(char *tptr, char *fp, int l)
* to lovely unix /'s :-} */
*tptr++='.';
-#ifdef KANJI
- while (l > 0) {
- if (is_shift_jis (*fp)) {
- *tptr++ = *fp++;
- *tptr++ = *fp++;
- l -= 2;
- } else if (is_kana (*fp)) {
- *tptr++ = *fp++;
- l--;
- } else if (*fp == '\\') {
- *tptr++ = '/';
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ {
+ while (l > 0) {
+ if (is_shift_jis (*fp)) {
+ *tptr++ = *fp++;
+ *tptr++ = *fp++;
+ l -= 2;
+ } else if (is_kana (*fp)) {
+ *tptr++ = *fp++;
+ l--;
+ } else if (*fp == '\\') {
+ *tptr++ = '/';
+ fp++;
+ l--;
+ } else {
+ *tptr++ = *fp++;
+ l--;
+ }
+ }
+ }
+ else
+ {
+ while (l--)
+ {
+ *tptr=(*fp == '\\') ? '/' : *fp;
+ tptr++;
fp++;
- l--;
- } else {
- *tptr++ = *fp++;
- l--;
}
}
-#else
- while (l--) { *tptr=(*fp == '\\') ? '/' : *fp; tptr++; fp++; }
-#endif
}
/****************************************************************************
@@ -1203,27 +1211,35 @@ static void unfixtarname(char *tptr, char *fp, int l)
if (*fp == '.') fp++;
if (*fp == '\\' || *fp == '/') fp++;
-#ifdef KANJI
- while (l > 0) {
- if (is_shift_jis (*fp)) {
- *tptr++ = *fp++;
- *tptr++ = *fp++;
- l -= 2;
- } else if (is_kana (*fp)) {
- *tptr++ = *fp++;
- l--;
- } else if (*fp == '/') {
- *tptr++ = '\\';
+ if(lp_client_code_page() == KANJI_CODEPAGE)
+ {
+ while (l > 0) {
+ if (is_shift_jis (*fp)) {
+ *tptr++ = *fp++;
+ *tptr++ = *fp++;
+ l -= 2;
+ } else if (is_kana (*fp)) {
+ *tptr++ = *fp++;
+ l--;
+ } else if (*fp == '/') {
+ *tptr++ = '\\';
+ fp++;
+ l--;
+ } else {
+ *tptr++ = *fp++;
+ l--;
+ }
+ }
+ }
+ else
+ {
+ while (l--)
+ {
+ *tptr=(*fp == '/') ? '\\' : *fp;
+ tptr++;
fp++;
- l--;
- } else {
- *tptr++ = *fp++;
- l--;
}
}
-#else
- while (l--) { *tptr=(*fp == '/') ? '\\' : *fp; tptr++; fp++; }
-#endif
}
static void do_tarput()