diff options
author | hobbs <hobbs@noemail.net> | 1999-12-01 00:08:36 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 1999-12-01 00:08:36 (GMT) |
commit | dbc86a58668fb5f5ee6890923b5061ec5ab7c64c (patch) | |
tree | 9bd881a878bfb4fb72b29a617bd39d432c1dfcc3 /win | |
parent | 63de6e7c79c18682d12967ef21e23baec90c740a (diff) | |
download | tcl-dbc86a58668fb5f5ee6890923b5061ec5ab7c64c.zip tcl-dbc86a58668fb5f5ee6890923b5061ec5ab7c64c.tar.gz tcl-dbc86a58668fb5f5ee6890923b5061ec5ab7c64c.tar.bz2 |
* win/tclWinTime.c: fixed handling of %Z on NT for time zones
that don't have DST.
FossilOrigin-Name: 2aab86d6ee0cbc2fd8ef3a93b440ac60378c110f
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinTime.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/win/tclWinTime.c b/win/tclWinTime.c index de0e3dd..db2affd 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinTime.c,v 1.4 1999/04/16 00:48:10 stanton Exp $ + * RCS: @(#) $Id: tclWinTime.c,v 1.5 1999/12/01 00:08:43 hobbs Exp $ */ #include "tclWinInt.h" @@ -219,17 +219,20 @@ TclpGetTZName(int dst) Tcl_ExternalToUtf(NULL, NULL, zone, len, 0, NULL, name, sizeof(tsdPtr->tzName), NULL, NULL, NULL); } - if ((name[0] == '\0') - && (GetTimeZoneInformation(&tz) != TIME_ZONE_ID_UNKNOWN)) { + if (name[0] == '\0') { + if (GetTimeZoneInformation(&tz) == TIME_ZONE_ID_UNKNOWN) { + /* + * MSDN: On NT this is returned if DST is not used in + * the current TZ + */ + dst = 0; + } encoding = Tcl_GetEncoding(NULL, "unicode"); Tcl_ExternalToUtf(NULL, encoding, (char *) ((dst) ? tz.DaylightName : tz.StandardName), -1, 0, NULL, name, sizeof(tsdPtr->tzName), NULL, NULL, NULL); Tcl_FreeEncoding(encoding); } - if (name[0] == '\0') { - return "%Z"; - } return name; } |