OLD | NEW |
| (Empty) |
1 diff --git a/source/common/putil.cpp b/source/common/putil.cpp | |
2 index 599dad9..0f5090c 100644 | |
3 --- a/source/common/putil.cpp | |
4 +++ b/source/common/putil.cpp | |
5 @@ -970,6 +970,15 @@ static char* searchForTZFile(const char* path, DefaultTZInf
o* tzInfo) { | |
6 return result; | |
7 } | |
8 #endif | |
9 + | |
10 +U_CAPI void U_EXPORT2 | |
11 +uprv_tzname_clear_cache() | |
12 +{ | |
13 +#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK) | |
14 + gTimeZoneBufferPtr = NULL; | |
15 +#endif | |
16 +} | |
17 + | |
18 U_CAPI const char* U_EXPORT2 | |
19 uprv_tzname(int n) | |
20 { | |
21 diff --git a/source/common/putilimp.h b/source/common/putilimp.h | |
22 index d2c1c66..e3da340 100644 | |
23 --- a/source/common/putilimp.h | |
24 +++ b/source/common/putilimp.h | |
25 @@ -483,6 +483,12 @@ U_INTERNAL int32_t U_EXPORT2 uprv_timezone(void); | |
26 U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n); | |
27 | |
28 /** | |
29 + * Reset the global tzname cache. | |
30 + * @internal | |
31 + */ | |
32 +U_INTERNAL void uprv_tzname_clear_cache(); | |
33 + | |
34 +/** | |
35 * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970. | |
36 * This function is affected by 'faketime' and should be the bottleneck for all
user-visible ICU time functions. | |
37 * @return the UTC time measured in milliseconds | |
38 diff --git a/source/i18n/timezone.cpp b/source/i18n/timezone.cpp | |
39 index 6b3f8d2..a80fdda 100644 | |
40 --- a/source/i18n/timezone.cpp | |
41 +++ b/source/i18n/timezone.cpp | |
42 @@ -453,6 +453,8 @@ TimeZone::detectHostTimeZone() | |
43 | |
44 uprv_tzset(); // Initialize tz... system data | |
45 | |
46 + uprv_tzname_clear_cache(); | |
47 + | |
48 // Get the timezone ID from the host. This function should do | |
49 // any required host-specific remapping; e.g., on Windows this | |
50 // function maps the Date and Time control panel setting to an | |
OLD | NEW |