summaryrefslogtreecommitdiffstats
path: root/compat/strftime.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-11-04 18:18:03 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-11-04 18:18:03 (GMT)
commit05f6317032522fa4b68966fe3c1ef854d87fbf6e (patch)
tree080fd0720b470aa04f090111e31e27826a699452 /compat/strftime.c
parentc2f30c4326efeeaff9b28a2015ab079750bfd038 (diff)
downloadtcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.zip
tcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.tar.gz
tcl-05f6317032522fa4b68966fe3c1ef854d87fbf6e.tar.bz2
Bug 1317477
Diffstat (limited to 'compat/strftime.c')
-rw-r--r--compat/strftime.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/compat/strftime.c b/compat/strftime.c
index 609c193..7d2c416 100644
--- a/compat/strftime.c
+++ b/compat/strftime.c
@@ -10,7 +10,7 @@
*
* Changes 2002 Copyright (c) 2002 ActiveState Corporation.
*
- * RCS: @(#) $Id: strftime.c,v 1.10.2.2 2004/09/08 18:32:20 kennykb Exp $
+ * RCS: @(#) $Id: strftime.c,v 1.10.2.3 2005/11/04 18:18:04 kennykb Exp $
*/
/*
@@ -47,7 +47,7 @@
*/
#if defined(LIBC_SCCS)
-static char *rcsid = "$Id: strftime.c,v 1.10.2.2 2004/09/08 18:32:20 kennykb Exp $";
+static char *rcsid = "$Id: strftime.c,v 1.10.2.3 2005/11/04 18:18:04 kennykb Exp $";
#endif /* LIBC_SCCS */
#include <time.h>
@@ -339,9 +339,11 @@ _fmt(format, t)
* we must make use of the special localized calls.
*/
case 'c':
- if (!GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE,
- &syst, NULL, buf, BUF_SIZ) || !_add(buf)
- || !_add(" ")) {
+ if (!GetDateFormat(LOCALE_USER_DEFAULT,
+ DATE_LONGDATE | LOCALE_USE_CP_ACP,
+ &syst, NULL, buf, BUF_SIZ)
+ || !_add(buf)
+ || !_add(" ")) {
return(0);
}
/*
@@ -349,14 +351,18 @@ _fmt(format, t)
* so continue to %X case here.
*/
case 'X':
- if (!GetTimeFormat(LOCALE_USER_DEFAULT, 0,
- &syst, NULL, buf, BUF_SIZ) || !_add(buf)) {
+ if (!GetTimeFormat(LOCALE_USER_DEFAULT,
+ LOCALE_USE_CP_ACP,
+ &syst, NULL, buf, BUF_SIZ)
+ || !_add(buf)) {
return(0);
}
continue;
case 'x':
- if (!GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE,
- &syst, NULL, buf, BUF_SIZ) || !_add(buf)) {
+ if (!GetDateFormat(LOCALE_USER_DEFAULT,
+ DATE_SHORTDATE | LOCALE_USE_CP_ACP,
+ &syst, NULL, buf, BUF_SIZ)
+ || !_add(buf)) {
return(0);
}
continue;
@@ -385,9 +391,11 @@ _fmt(format, t)
continue;
case 'Z': {
char *name = (isGMT ? "GMT" : TclpGetTZName(t->tm_isdst));
- if (name && !_add(name)) {
- return 0;
- }
+ int wrote;
+ Tcl_UtfToExternal(NULL, NULL, name, -1, 0, NULL,
+ pt, gsize, NULL, &wrote, NULL);
+ pt += wrote;
+ gsize -= wrote;
continue;
}
case '%':