From c37c1eb6675a452c95bd4f761fc9e28934eb29ad Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Sun, 22 Mar 2009 04:32:22 +0000 Subject: only run setlocale once --- lib/charset.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/charset.c') diff --git a/lib/charset.c b/lib/charset.c index 19dfb7e..dabe4b8 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -25,12 +25,16 @@ ZGetCharset(char *charset) { char *p; short retval; + static int once = 1; if (charset == NULL) charset = getenv("ZEPHYR_CHARSET"); if (charset == NULL) { - setlocale(LC_ALL, ""); + if (once) { + setlocale(LC_ALL, ""); + once = 0; + } charset = nl_langinfo(CODESET); } -- cgit v1.2.3