From 442b9f3e87ee7f9fe8c100cd37c9591733e290e6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Mar 2005 02:14:38 +0000 Subject: r5933: We were handling setting of EA's incorrectly - we should be able to set a list. Also not converting names from DOS CP to UNIX CP correctly. This code doesn't quite work yet but it's a work in progress to be fixed tomorrow (don't want to lose it). Jeremy. (This used to be commit 22fca746576810c5408540031a9603625a66cd75) --- source3/lib/charcnv.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index b9b9d90db6..4fbad0f3d1 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -1268,6 +1268,21 @@ size_t pull_utf8_allocate(char **dest, const char *src) return convert_string_allocate(NULL, CH_UTF8, CH_UNIX, src, src_len, (void **)dest, True); } +/** + * Copy a string from a DOS src to a unix char * destination, allocating a buffer using talloc + * + * @param dest always set at least to NULL + * + * @returns The number of bytes occupied by the string in the destination + **/ + +size_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src) +{ + size_t src_len = strlen(src)+1; + *dest = NULL; + return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest, True); +} + /** Copy a string from a char* src to a unicode or ascii dos codepage destination choosing unicode or ascii based on the -- cgit