From b60d612cdeb7dad7c1e2496c5b1e19abb58da50f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 23 Sep 2008 08:32:42 +0200 Subject: s4: add talloc_strdup_upper. Guenther --- source4/lib/charset/util_unistr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index 09ec7b0471..a8ff88423a 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -570,7 +570,13 @@ _PUBLIC_ char *strupper_talloc(TALLOC_CTX *ctx, const char *src) return strupper_talloc_n(ctx, src, src?strlen(src):0); } - +/** + talloc_strdup() a unix string to upper case. +**/ +_PUBLIC_ char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src) +{ + return strupper_talloc(ctx, src); +} /** Convert a string to lower case. -- cgit From 5477e1cbf90e3814713653e86af5e1d14518bc9c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 23 Sep 2008 21:06:41 +0200 Subject: s4:lib/charset: add missing prototype of talloc_strdup_upper() metze --- source4/lib/charset/charset.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/charset.h b/source4/lib/charset/charset.h index c49745cd7f..d4dae4cdad 100644 --- a/source4/lib/charset/charset.h +++ b/source4/lib/charset/charset.h @@ -97,6 +97,7 @@ size_t count_chars_w(const char *s, char c); void strupper_m(char *s); void strlower_m(char *s); char *strupper_talloc(TALLOC_CTX *ctx, const char *src); +char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *src); char *strupper_talloc_n(TALLOC_CTX *ctx, const char *src, size_t n); char *strlower_talloc(TALLOC_CTX *ctx, const char *src); bool strhasupper(const char *string); -- cgit From 2c978bbfa92b7fe29c17e40ad6d8059814b78399 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Sep 2008 13:57:23 -0700 Subject: handle NULL strings in strchr_m() and strrchr_m() This is needed for the LSA server code which needs to cope with a NULL names passed to lsa_LookupNames3() --- source4/lib/charset/util_unistr.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index a8ff88423a..5f3b2c53f1 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -386,6 +386,9 @@ _PUBLIC_ size_t strlen_m_term(const char *s) **/ _PUBLIC_ char *strchr_m(const char *s, char c) { + if (s == NULL) { + return NULL; + } /* characters below 0x3F are guaranteed to not appear in non-initial position in multi-byte charsets */ if ((c & 0xC0) == 0) { @@ -411,6 +414,10 @@ _PUBLIC_ char *strrchr_m(const char *s, char c) { char *ret = NULL; + if (s == NULL) { + return NULL; + } + /* characters below 0x3F are guaranteed to not appear in non-initial position in multi-byte charsets */ if ((c & 0xC0) == 0) { -- cgit From 956599975573044f5f930ef23ce54c11db156ebe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Oct 2008 21:31:42 +0200 Subject: Fix include paths to new location of libutil. --- source4/lib/charset/iconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/iconv.c b/source4/lib/charset/iconv.c index d4f930b462..150383e7f9 100644 --- a/source4/lib/charset/iconv.c +++ b/source4/lib/charset/iconv.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "lib/util/dlinklist.h" +#include "../lib/util/dlinklist.h" #include "system/iconv.h" #include "system/filesys.h" #include "param/param.h" -- cgit From 93e52145a887b1865d41ae5272047423bbfb33b3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Oct 2008 13:24:16 +0200 Subject: Provide two symbols to allow ndrdump compiled by Samba 3 to be used for Samba 4. --- source4/lib/charset/util_unistr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c index 5f3b2c53f1..e4f4bb551a 100644 --- a/source4/lib/charset/util_unistr.c +++ b/source4/lib/charset/util_unistr.c @@ -37,7 +37,7 @@ static void *lowcase_table; /******************************************************************* load the case handling tables ********************************************************************/ -static void load_case_tables(void) +void load_case_tables(void) { TALLOC_CTX *mem_ctx; -- cgit From 87ec1d2532eb17dfd7f98431bdfa4071be57f683 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 20 Oct 2008 18:59:51 +0200 Subject: Make sure prototypes are always included, make some functions static and remove some unused functions. --- source4/lib/charset/charset.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/charset') diff --git a/source4/lib/charset/charset.h b/source4/lib/charset/charset.h index d4dae4cdad..041eaeace7 100644 --- a/source4/lib/charset/charset.h +++ b/source4/lib/charset/charset.h @@ -147,4 +147,8 @@ struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx, const char *dos_charset, const char *unix_charset, bool native_iconv); + +void load_case_tables(void); +bool charset_register_backend(const void *_funcs); + #endif /* __CHARSET_H__ */ -- cgit