summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-10 05:49:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:35 -0500
commit92a7eb69d393e10d4fa422871d68a0728692cd38 (patch)
tree0a0665952a8e1c63db7d3274a3f207119f9296a2 /source3/lib
parent822fcec39d6597524a94b0e8b9c244d5eb62b972 (diff)
downloadsamba-92a7eb69d393e10d4fa422871d68a0728692cd38.tar.gz
samba-92a7eb69d393e10d4fa422871d68a0728692cd38.tar.bz2
samba-92a7eb69d393e10d4fa422871d68a0728692cd38.zip
r4126: Fix from Björn Jacke <bjoern@j3e.de> for bugid #2040 - ensure the locale
is reset to C to get ASCII-compatible toupper/lower functions. Jeremy. (This used to be commit 8e1b1693abf1e6eb46b23a5fa56776fc2ede7982)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charcnv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index e8ceaf39b7..b9b9d90db6 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -84,6 +84,15 @@ static const char *charset_name(charset_t ch)
}
ret = ln;
}
+#ifdef HAVE_SETLOCALE
+ /* We set back the locale to C to get ASCII-compatible toupper/lower functions.
+ For now we do not need any other POSIX localisations anyway. When we should
+ really need localized string functions one day we need to write our own
+ ascii_tolower etc.
+ */
+ setlocale(LC_ALL, "C");
+ #endif
+
#endif
if (!ret || !*ret) ret = "ASCII";