From 6d29d83763ad48285d295d6b75eafbf085adf40d Mon Sep 17 00:00:00 2001 From: rmax Date: Wed, 26 Jun 2002 13:42:23 +0000 Subject: * unix/tclUnixTime.c: Make [clock format] respect locale settings. * tests/clock.test: Bug #565880. ***POTENTIAL INCOMPATIBILITY*** --- ChangeLog | 5 +++++ tests/clock.test | 4 +++- unix/tclUnixTime.c | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a426773..f2148a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-06-26 Reinhard Max + + * unix/tclUnixTime.c: Make [clock format] respect locale settings. + * tests/clock.test: Bug #565880. ***POTENTIAL INCOMPATIBILITY*** + 2002-06-26 Miguel Sofer * doc/CrtInterp.3: diff --git a/tests/clock.test b/tests/clock.test index 1c7cf57..8f4014e 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -10,7 +10,9 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: clock.test,v 1.19 2002/05/29 09:08:43 hobbs Exp $ +# RCS: @(#) $Id: clock.test,v 1.20 2002/06/26 13:42:23 rmax Exp $ + +set env(LC_TIME) POSIX if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c index 5107062..85ba721 100644 --- a/unix/tclUnixTime.c +++ b/unix/tclUnixTime.c @@ -9,11 +9,12 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTime.c,v 1.13 2002/05/29 00:19:39 hobbs Exp $ + * RCS: @(#) $Id: tclUnixTime.c,v 1.14 2002/06/26 13:42:23 rmax Exp $ */ #include "tclInt.h" #include "tclPort.h" +#include #define TM_YEAR_BASE 1900 #define IsLeapYear(x) ((x % 4 == 0) && (x % 100 != 0 || x % 400 == 0)) @@ -332,6 +333,7 @@ TclpStrftime(s, maxsize, format, t, useGMT) (((t->tm_hour * 60) + t->tm_min)/144)); return(strlen(s)); } + setlocale(LC_TIME, ""); return strftime(s, maxsize, format, t); } -- cgit v0.12