Tcl Source Code

Artifact [b8565a612b]
Login

Artifact b8565a612bfddba5a734e9fee5aa5d09459b896a:

Attachment "clock_locale.patch" to ticket [565880ffff] added by rmax 2002-06-07 22:59:36.
Index: unix/tclUnixTime.c
===================================================================
RCS file: /cvsroot/tcl/tcl/unix/tclUnixTime.c,v
retrieving revision 1.13
diff -u -r1.13 tclUnixTime.c
--- unix/tclUnixTime.c	29 May 2002 00:19:39 -0000	1.13
+++ unix/tclUnixTime.c	7 Jun 2002 15:36:25 -0000
@@ -14,6 +14,7 @@
 
 #include "tclInt.h"
 #include "tclPort.h"
+#include <locale.h>
 #define TM_YEAR_BASE 1900
 #define IsLeapYear(x)   ((x % 4 == 0) && (x % 100 != 0 || x % 400 == 0))
 
@@ -332,6 +333,7 @@
 		(((t->tm_hour * 60) + t->tm_min)/144));
 	return(strlen(s));
     }
+    setlocale(LC_TIME, "");
     return strftime(s, maxsize, format, t);
 }
 
Index: tests/clock.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/clock.test,v
retrieving revision 1.19
diff -u -r1.19 clock.test
--- tests/clock.test	29 May 2002 09:08:43 -0000	1.19
+++ tests/clock.test	7 Jun 2002 15:36:26 -0000
@@ -12,6 +12,8 @@
 #
 # RCS: @(#) $Id: clock.test,v 1.19 2002/05/29 09:08:43 hobbs Exp $
 
+set env(LC_TIME) POSIX
+
 if {[lsearch [namespace children] ::tcltest] == -1} {
     package require tcltest
     namespace import -force ::tcltest::*