mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Make TZNAME_GLOBAL for reference to tzname global variable.
This commit is contained in:
@@ -1065,8 +1065,8 @@ abstime2tm(AbsoluteTime _time, int *tzp, struct tm * tm, char **tzn)
|
||||
* case it contains an error message, which doesn't fit in the
|
||||
* buffer
|
||||
*/
|
||||
StrNCpy(*tzn, tzname[tm->tm_isdst], MAXTZLEN + 1);
|
||||
if (strlen(tzname[tm->tm_isdst]) > MAXTZLEN)
|
||||
StrNCpy(*tzn, TZNAME_GLOBAL[tm->tm_isdst], MAXTZLEN + 1);
|
||||
if (strlen(TZNAME_GLOBAL[tm->tm_isdst]) > MAXTZLEN)
|
||||
tm->tm_isdst = -1;
|
||||
}
|
||||
}
|
||||
|
@@ -223,7 +223,7 @@ timestamp2tm(timestamp dt, int *tzp, struct tm * tm, fsec_t *fsec, char **tzn)
|
||||
#elif defined(HAVE_INT_TIMEZONE)
|
||||
*tzp = ((tm->tm_isdst > 0) ? (TIMEZONE_GLOBAL - 3600) : TIMEZONE_GLOBAL);
|
||||
if (tzn != NULL)
|
||||
*tzn = tzname[(tm->tm_isdst > 0)];
|
||||
*tzn = TZNAME_GLOBAL[(tm->tm_isdst > 0)];
|
||||
#endif
|
||||
|
||||
#else /* not (HAVE_TM_ZONE || HAVE_INT_TIMEZONE) */
|
||||
|
Reference in New Issue
Block a user