summaryrefslogtreecommitdiff
path: root/lib/util/dprintf.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-22 09:52:31 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-23 13:47:27 +0200
commit125a2ff262aa312df20eec68802fd5f8a47f492f (patch)
tree7308c0b58fa7016d8d174f2b50db32567f204895 /lib/util/dprintf.c
parent6c3cef773a989f175c518b435feebab287a58cf0 (diff)
downloadsamba-125a2ff262aa312df20eec68802fd5f8a47f492f.tar.gz
samba-125a2ff262aa312df20eec68802fd5f8a47f492f.tar.bz2
samba-125a2ff262aa312df20eec68802fd5f8a47f492f.zip
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.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/lib/util/dprintf.c b/lib/util/dprintf.c
index 376eb4c75e..90ca36c1ae 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);
}