summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c19
-rw-r--r--source3/client/clitar.c63
-rw-r--r--source3/client/smbmount.c19
3 files changed, 29 insertions, 72 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 798dfe577e..988b6685a8 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -130,13 +130,8 @@ extern int Client;
#define USENMB
-static BOOL setup_term_code(char *code)
-{
- interpret_coding_system(code);
- return True;
-}
-#define CNV_LANG(s) dos2unix_format(s,False)
-#define CNV_INPUT(s) unix2dos_format(s,True)
+#define CNV_LANG(s) dos_to_unix(s,False)
+#define CNV_INPUT(s) unix_to_dos(s,True)
/****************************************************************************
send an SMBclose on an SMB file handle
@@ -3756,15 +3751,7 @@ static void usage(char *pname)
codepage_initialise(lp_client_code_page());
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- if (!setup_term_code (term_code))
- {
- DEBUG(0, ("%s: unknown terminal code name\n", optarg));
- usage (pname);
- exit (1);
- }
- }
+ interpret_coding_system(term_code);
if (*workgroup == 0)
strcpy(workgroup,lp_workgroup());
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 6a811f41c7..ccaab486d0 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -322,33 +322,25 @@ static void fixtarname(char *tptr, char *fp, int l)
* to lovely unix /'s :-} */
*tptr++='.';
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- while (l > 0) {
- if (is_shift_jis (*fp)) {
+
+ while (l > 0) {
+ int skip;
+ if((skip = skip_multibyte_char( *fp)) != 0) {
+ if (skip == 2) {
*tptr++ = *fp++;
*tptr++ = *fp++;
l -= 2;
- } else if (is_kana (*fp)) {
- *tptr++ = *fp++;
- l--;
- } else if (*fp == '\\') {
- *tptr++ = '/';
- fp++;
- l--;
- } else {
+ } else if (skip == 1) {
*tptr++ = *fp++;
l--;
}
- }
- }
- else
- {
- while (l--)
- {
- *tptr=(*fp == '\\') ? '/' : *fp;
- tptr++;
+ } else if (*fp == '\\') {
+ *tptr++ = '/';
fp++;
+ l--;
+ } else {
+ *tptr++ = *fp++;
+ l--;
}
}
}
@@ -1227,33 +1219,24 @@ static void unfixtarname(char *tptr, char *fp, int l)
if (*fp == '.') fp++;
if (*fp == '\\' || *fp == '/') fp++;
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- while (l > 0) {
- if (is_shift_jis (*fp)) {
+ while (l > 0) {
+ int skip;
+ if(( skip = skip_multibyte_char( *fp )) != 0) {
+ if (skip == 2) {
*tptr++ = *fp++;
*tptr++ = *fp++;
l -= 2;
- } else if (is_kana (*fp)) {
- *tptr++ = *fp++;
- l--;
- } else if (*fp == '/') {
- *tptr++ = '\\';
- fp++;
- l--;
- } else {
+ } else if (skip == 1) {
*tptr++ = *fp++;
l--;
}
- }
- }
- else
- {
- while (l--)
- {
- *tptr=(*fp == '/') ? '\\' : *fp;
- tptr++;
+ } else if (*fp == '/') {
+ *tptr++ = '\\';
fp++;
+ l--;
+ } else {
+ *tptr++ = *fp++;
+ l--;
}
}
}
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index 847c4b1f3d..e5902ff0d9 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -136,13 +136,8 @@ extern int Client;
#define USENMB
-static BOOL setup_term_code(char *code)
-{
- interpret_coding_system(code);
- return True;
-}
-#define CNV_LANG(s) dos2unix_format(s,False)
-#define CNV_INPUT(s) unix2dos_format(s,True)
+#define CNV_LANG(s) dos_to_unix(s,False)
+#define CNV_INPUT(s) unix_to_dos(s,True)
/****************************************************************************
check for existance of a dir
@@ -879,15 +874,7 @@ static void usage(char *pname)
codepage_initialise(lp_client_code_page());
- if(lp_client_code_page() == KANJI_CODEPAGE)
- {
- if (!setup_term_code (term_code))
- {
- DEBUG(0, ("%s: unknown terminal code name\n", optarg));
- usage (pname);
- exit (1);
- }
- }
+ interpret_coding_system(term_code);
if (*workgroup == 0)
strcpy(workgroup,lp_workgroup());