summaryrefslogtreecommitdiff
path: root/lib/util/charset
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-24 01:19:33 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-24 01:19:33 +0200
commit5e4767b532cc2f7401a9a1e7601433bd5acbdf35 (patch)
treee892225907e606749ea8ca95e86736253d7bae2d /lib/util/charset
parent420781bf46a036bcf308eaa6390bd07ab18be7b1 (diff)
downloadsamba-5e4767b532cc2f7401a9a1e7601433bd5acbdf35.tar.gz
samba-5e4767b532cc2f7401a9a1e7601433bd5acbdf35.tar.bz2
samba-5e4767b532cc2f7401a9a1e7601433bd5acbdf35.zip
Rename string_replace_w to string_replace_m, which is more correct.
Diffstat (limited to 'lib/util/charset')
-rw-r--r--lib/util/charset/charset.h2
-rw-r--r--lib/util/charset/config.mk2
-rw-r--r--lib/util/charset/tests/charset.c14
-rw-r--r--lib/util/charset/util_unistr.c2
4 files changed, 9 insertions, 11 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h
index 041eaeace7..a4028270f1 100644
--- a/lib/util/charset/charset.h
+++ b/lib/util/charset/charset.h
@@ -87,7 +87,7 @@ char *strchr_m(const char *s, char c);
size_t strlen_m_term(const char *s);
size_t strlen_m(const char *s);
char *alpha_strcpy(char *dest, const char *src, const char *other_safe_chars, size_t maxlength);
-void string_replace_w(char *s, char oldc, char newc);
+void string_replace_m(char *s, char oldc, char newc);
bool strcsequal_w(const char *s1,const char *s2);
bool strequal_w(const char *s1, const char *s2);
int strncasecmp_m(const char *s1, const char *s2, size_t n);
diff --git a/lib/util/charset/config.mk b/lib/util/charset/config.mk
index 12c2f5f321..56e0e7b36c 100644
--- a/lib/util/charset/config.mk
+++ b/lib/util/charset/config.mk
@@ -9,5 +9,3 @@ PRIVATE_DEPENDENCIES = DYNCONFIG
CHARSET_OBJ_FILES = $(addprefix $(libcharsetsrcdir)/, iconv.o charcnv.o util_unistr.o)
PUBLIC_HEADERS += $(libcharsetsrcdir)/charset.h
-
-$(eval $(call proto_header_template,$(libcharsetsrcdir)/charset_proto.h,$(CHARSET_OBJ_FILES:.o=.c)))
diff --git a/lib/util/charset/tests/charset.c b/lib/util/charset/tests/charset.c
index 5e42ca2932..e7e4dd7cc8 100644
--- a/lib/util/charset/tests/charset.c
+++ b/lib/util/charset/tests/charset.c
@@ -80,21 +80,21 @@ static bool test_strcsequal_w(struct torture_context *tctx)
return true;
}
-static bool test_string_replace_w(struct torture_context *tctx)
+static bool test_string_replace_m(struct torture_context *tctx)
{
char data[6] = "bla";
- string_replace_w(data, 'b', 'c');
+ string_replace_m(data, 'b', 'c');
torture_assert_str_equal(tctx, data, "cla", "first char replaced");
memcpy(data, "bab", 4);
- string_replace_w(data, 'b', 'c');
+ string_replace_m(data, 'b', 'c');
torture_assert_str_equal(tctx, data, "cac", "other chars replaced");
memcpy(data, "bba", 4);
- string_replace_w(data, 'b', 'c');
+ string_replace_m(data, 'b', 'c');
torture_assert_str_equal(tctx, data, "cca", "other chars replaced");
memcpy(data, "blala", 6);
- string_replace_w(data, 'o', 'c');
+ string_replace_m(data, 'o', 'c');
torture_assert_str_equal(tctx, data, "blala", "no chars replaced");
- string_replace_w(NULL, 'b', 'c');
+ string_replace_m(NULL, 'b', 'c');
return true;
}
@@ -254,7 +254,7 @@ struct torture_suite *torture_local_charset(TALLOC_CTX *mem_ctx)
torture_suite_add_simple_test(suite, "strcasecmp_m", test_strcasecmp_m);
torture_suite_add_simple_test(suite, "strequal_w", test_strequal_w);
torture_suite_add_simple_test(suite, "strcsequal_w", test_strcsequal_w);
- torture_suite_add_simple_test(suite, "string_replace_w", test_string_replace_w);
+ torture_suite_add_simple_test(suite, "string_replace_m", test_string_replace_m);
torture_suite_add_simple_test(suite, "strncasecmp_m", test_strncasecmp_m);
torture_suite_add_simple_test(suite, "next_token", test_next_token);
torture_suite_add_simple_test(suite, "next_token_null", test_next_token_null);
diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c
index e4f4bb551a..7fee71cc8d 100644
--- a/lib/util/charset/util_unistr.c
+++ b/lib/util/charset/util_unistr.c
@@ -274,7 +274,7 @@ _PUBLIC_ bool strcsequal_w(const char *s1,const char *s2)
String replace.
NOTE: oldc and newc must be 7 bit characters
**/
-_PUBLIC_ void string_replace_w(char *s, char oldc, char newc)
+_PUBLIC_ void string_replace_m(char *s, char oldc, char newc)
{
while (s && *s) {
size_t size;