svn commit: samba r4123 - in branches/SAMBA_4_0/source: build/m4 lib

tridge at samba.org tridge at samba.org
Fri Dec 10 03:41:54 GMT 2004


Author: tridge
Date: 2004-12-10 03:41:54 +0000 (Fri, 10 Dec 2004)
New Revision: 4123

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4123

Log:
set locale to C to ensure ascii string functions work

thanks to Bjoern JACKE <samba at j3e.de> for pointing this out



Modified:
   branches/SAMBA_4_0/source/build/m4/rewrite.m4
   branches/SAMBA_4_0/source/lib/charcnv.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/m4/rewrite.m4
===================================================================
--- branches/SAMBA_4_0/source/build/m4/rewrite.m4	2004-12-09 22:10:48 UTC (rev 4122)
+++ branches/SAMBA_4_0/source/build/m4/rewrite.m4	2004-12-10 03:41:54 UTC (rev 4123)
@@ -424,6 +424,8 @@
 AC_CHECK_FUNCS(getdents)
 AC_CHECK_FUNCS(pread pwrite)
 
+# needed for lib/charcnv.c
+AC_CHECK_FUNCS(setlocale)
 
 #
 # stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX

Modified: branches/SAMBA_4_0/source/lib/charcnv.c
===================================================================
--- branches/SAMBA_4_0/source/lib/charcnv.c	2004-12-09 22:10:48 UTC (rev 4122)
+++ branches/SAMBA_4_0/source/lib/charcnv.c	2004-12-10 03:41:54 UTC (rev 4123)
@@ -88,6 +88,17 @@
 	   to look at */
 	if (initialised == 0) {
 		initialised = 1;
+		
+#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
+
 		atexit(init_iconv);
 	}
 



More information about the samba-cvs mailing list