diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-22 09:52:31 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-23 13:47:27 +0200 |
commit | 125a2ff262aa312df20eec68802fd5f8a47f492f (patch) | |
tree | 7308c0b58fa7016d8d174f2b50db32567f204895 /lib/util/dprintf.c | |
parent | 6c3cef773a989f175c518b435feebab287a58cf0 (diff) | |
download | samba-125a2ff262aa312df20eec68802fd5f8a47f492f.tar.gz |
lib/util/charset: Remove 'display charset'
As discussed in 'CH_DISPLAY and gettext' on the samba-technical list:
http://lists.samba.org/archive/samba-technical/2011-June/078190.html
Setting this to a value other than 'unix charset' does not make sense,
as any system where the filesytem charset does not equal the terminal
charset will already have problems with programs as simple as 'ls'.
It also means that our output could not be pasted as our input in
interactive programs or onto our command line, as we never did
translate in the DISPLAY -> UNIX direction.
The d_printf() calls are retained in case we need to revisit this, and
to support display_set_stderr().
Andrew Bartlett
Diffstat (limited to 'lib/util/dprintf.c')
-rw-r--r-- | lib/util/dprintf.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/lib/util/dprintf.c b/lib/util/dprintf.c index 376eb4c75e4..90ca36c1ae5 100644 --- a/lib/util/dprintf.c +++ b/lib/util/dprintf.c @@ -36,40 +36,7 @@ static int d_vfprintf(FILE *f, const char *format, va_list ap) { - char *p, *p2; - int ret; - size_t clen; - bool cret; - va_list ap2; - - va_copy(ap2, ap); - ret = vasprintf(&p, format, ap2); - va_end(ap2); - - if (ret <= 0) return ret; - - cret = convert_string_talloc(NULL, CH_UNIX, CH_DISPLAY, p, ret, (void **)&p2, &clen); - if (!cret) { - /* the string can't be converted - do the best we can, - filling in non-printing chars with '?' */ - int i; - for (i=0;i<ret;i++) { - if (isprint(p[i]) || isspace(p[i])) { - fwrite(p+i, 1, 1, f); - } else { - fwrite("?", 1, 1, f); - } - } - SAFE_FREE(p); - return ret; - } - - /* good, its converted OK */ - SAFE_FREE(p); - ret = fwrite(p2, 1, clen, f); - talloc_free(p2); - - return ret; + return vfprintf(f, format, ap); } |