summaryrefslogtreecommitdiff
path: root/source3/libsmb/clistr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-02-21 03:40:20 +0000
committerAndrew Tridgell <tridge@samba.org>2001-02-21 03:40:20 +0000
commita8ab9840786b8376283743de8eef861d382b3171 (patch)
treeb0724235c8223e11e1287f0b542bf9f2bd28ef1e /source3/libsmb/clistr.c
parent518f2fc391266c2f9b9cfc8b485a8e57ce359be8 (diff)
downloadsamba-a8ab9840786b8376283743de8eef861d382b3171.tar.gz
samba-a8ab9840786b8376283743de8eef861d382b3171.tar.bz2
samba-a8ab9840786b8376283743de8eef861d382b3171.zip
the unicode conversion of our client code is complete enough to be
enabled by default you can disable it by setting the environment variable CLI_FORCE_ASCII (This used to be commit 4d59c08c5e6f54c0d6ced7650750cb987e77b6c9)
Diffstat (limited to 'source3/libsmb/clistr.c')
-rw-r--r--source3/libsmb/clistr.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c
index da40fba9e6..9f46099ba9 100644
--- a/source3/libsmb/clistr.c
+++ b/source3/libsmb/clistr.c
@@ -23,9 +23,6 @@
#include "includes.h"
-/* we will delete this variable once our client side unicode support is complete */
-extern int cli_use_unicode;
-
/****************************************************************************
copy a string from a char* src to a unicode or ascii
dos code page destination choosing unicode or ascii based on the
@@ -55,7 +52,7 @@ int clistr_push(struct cli_state *cli, void *dest, char *src, int dest_len, int
len++;
}
- if ((flags & CLISTR_ASCII) || !cli_use_unicode || !(cli->capabilities & CAP_UNICODE)) {
+ if ((flags & CLISTR_ASCII) || !(cli->capabilities & CAP_UNICODE)) {
/* the server doesn't want unicode */
safe_strcpy(dest, src, dest_len);
len = strlen(dest);
@@ -91,7 +88,7 @@ int clistr_push_size(struct cli_state *cli, void *dest, char *src, int dest_len,
{
int len = strlen(src);
if (flags & CLISTR_TERMINATE) len++;
- if (!(flags & CLISTR_ASCII) && cli_use_unicode && (cli->capabilities & CAP_UNICODE)) len *= 2;
+ if (!(flags & CLISTR_ASCII) && (cli->capabilities & CAP_UNICODE)) len *= 2;
if (!(flags & CLISTR_ASCII) && dest && clistr_align(cli, PTR_DIFF(cli->outbuf, dest))) {
len++;
@@ -123,7 +120,7 @@ int clistr_pull(struct cli_state *cli, char *dest, void *src, int dest_len, int
if (src_len > 0) src_len--;
}
- if (!cli_use_unicode || !(cli->capabilities & CAP_UNICODE)) {
+ if (!(cli->capabilities & CAP_UNICODE)) {
/* the server doesn't want unicode */
if (flags & CLISTR_TERMINATE) {
safe_strcpy(dest, src, dest_len);
@@ -167,7 +164,7 @@ int clistr_pull_size(struct cli_state *cli, void *src, int src_len)
if (src_len > 0) src_len--;
}
- if (!cli_use_unicode || !(cli->capabilities & CAP_UNICODE)) {
+ if (!(cli->capabilities & CAP_UNICODE)) {
return strlen(src);
}
return strlen_w(src);
@@ -180,6 +177,6 @@ otherwise return 1 if offset is off
****************************************************************************/
int clistr_align(struct cli_state *cli, int offset)
{
- if (!cli_use_unicode || !(cli->capabilities & CAP_UNICODE)) return 0;
+ if (!(cli->capabilities & CAP_UNICODE)) return 0;
return offset & 1;
}