From 87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2001 07:15:53 +0000 Subject: The big character set handling changeover! This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a) --- source3/lib/util_file.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'source3/lib/util_file.c') diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index 4e2adc97bc..7dc25a8dae 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -417,7 +417,7 @@ char *file_load(char *fname, size_t *size) /**************************************************************************** parse a buffer into lines ****************************************************************************/ -static char **file_lines_parse(char *p, size_t size, int *numlines, BOOL convert) +static char **file_lines_parse(char *p, size_t size, int *numlines) { int i; char *s, **ret; @@ -446,21 +446,15 @@ static char **file_lines_parse(char *p, size_t size, int *numlines, BOOL convert if (s[0] == '\r') s[0] = 0; } - if (convert) { - for (i = 0; ret[i]; i++) - unix_to_dos(ret[i], True); - } - return ret; } /**************************************************************************** load a file into memory and return an array of pointers to lines in the file -must be freed with file_lines_free(). If convert is true calls unix_to_dos on -the list. +must be freed with file_lines_free(). ****************************************************************************/ -char **file_lines_load(char *fname, int *numlines, BOOL convert) +char **file_lines_load(char *fname, int *numlines) { char *p; size_t size; @@ -468,7 +462,7 @@ char **file_lines_load(char *fname, int *numlines, BOOL convert) p = file_load(fname, &size); if (!p) return NULL; - return file_lines_parse(p, size, numlines, convert); + return file_lines_parse(p, size, numlines); } /**************************************************************************** @@ -476,7 +470,7 @@ load a fd into memory and return an array of pointers to lines in the file must be freed with file_lines_free(). If convert is true calls unix_to_dos on the list. ****************************************************************************/ -char **fd_lines_load(int fd, int *numlines, BOOL convert) +char **fd_lines_load(int fd, int *numlines) { char *p; size_t size; @@ -484,16 +478,15 @@ char **fd_lines_load(int fd, int *numlines, BOOL convert) p = fd_load(fd, &size); if (!p) return NULL; - return file_lines_parse(p, size, numlines, convert); + return file_lines_parse(p, size, numlines); } /**************************************************************************** load a pipe into memory and return an array of pointers to lines in the data -must be freed with file_lines_free(). If convert is true calls unix_to_dos on -the list. +must be freed with file_lines_free(). ****************************************************************************/ -char **file_lines_pload(char *syscmd, int *numlines, BOOL convert) +char **file_lines_pload(char *syscmd, int *numlines) { char *p; size_t size; @@ -501,7 +494,7 @@ char **file_lines_pload(char *syscmd, int *numlines, BOOL convert) p = file_pload(syscmd, &size); if (!p) return NULL; - return file_lines_parse(p, size, numlines, convert); + return file_lines_parse(p, size, numlines); } /**************************************************************************** -- cgit