From c7ad164155b63215194187486dc72c397f71c931 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Wed, 8 May 2013 17:00:30 +0000 Subject: [PATCH] ICU-10082 Fix timezone detection on Solaris X-SVN-Rev: 33609 --- icu4c/source/common/putil.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/icu4c/source/common/putil.cpp b/icu4c/source/common/putil.cpp index 12e5a47bced..a6c941b56d3 100644 --- a/icu4c/source/common/putil.cpp +++ b/icu4c/source/common/putil.cpp @@ -681,6 +681,7 @@ extern U_IMPORT char *U_TZNAME[]; #elif U_PLATFORM == U_PF_SOLARIS #define TZDEFAULT "/etc/localtime" #define TZZONEINFO "/usr/share/lib/zoneinfo/" +#define TZZONEINFO2 "../usr/share/lib/zoneinfo/" #define TZ_ENV_CHECK "localtime" #else #define TZDEFAULT "/etc/localtime" @@ -1041,6 +1042,17 @@ uprv_tzname(int n) { return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); } +#if U_PLATFORM == U_PF_SOLARIS + else + { + tzZoneInfoLen = uprv_strlen(TZZONEINFO2); + if (uprv_strncmp(gTimeZoneBuffer, TZZONEINFO2, tzZoneInfoLen) == 0 + && isValidOlsonID(gTimeZoneBuffer + tzZoneInfoLen)) + { + return (gTimeZoneBufferPtr = gTimeZoneBuffer + tzZoneInfoLen); + } + } +#endif } else { #if defined(SEARCH_TZFILE) DefaultTZInfo* tzInfo = (DefaultTZInfo*)uprv_malloc(sizeof(DefaultTZInfo)); -- 2.40.0