diff options
author | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-01-17 16:46:56 +0000 |
---|---|---|
committer | Thomas G. Lockhart <lockhart@fourpalms.org> | 2001-01-17 16:46:56 +0000 |
commit | 8e9840383c94ee9da264b7b29d85cf2ce4866449 (patch) | |
tree | 8ebcae7abbf2eb8d55f0073b6c6ef569244c6a94 /src/backend/utils/adt/formatting.c | |
parent | 9a342d2035996720131ff96647f45f76b368ec53 (diff) | |
download | postgresql-8e9840383c94ee9da264b7b29d85cf2ce4866449.tar.gz postgresql-8e9840383c94ee9da264b7b29d85cf2ce4866449.zip |
Change comparisons of tm->tm_isdst from "nonzero" to "greater than zero".
Not sure why some were this way, and others were already correct, but it
seems to have been like this for several years.
This caused problems on a few damaged platforms like AIX and IRIX which do
not support DST calculations for years before 1970.
Thanks to Andreas Zeugswetter <ZeugswetterA@wien.spardat.at> for finding
the problem.
Diffstat (limited to 'src/backend/utils/adt/formatting.c')
-rw-r--r-- | src/backend/utils/adt/formatting.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 789b7b95130..7996c47f58f 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * formatting.c * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.28 2000/12/23 04:05:31 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.29 2001/01/17 16:46:56 thomas Exp $ * * * Portions Copyright (c) 1999-2000, PostgreSQL, Inc @@ -382,7 +382,7 @@ typedef struct { elog(DEBUG_elog_output, "TM:\nsec %d\nyear %d\nmin %d\nwday %d\nhour %d\nyday %d\nmday %d\nnisdst %d\nmon %d\n",\ tm->tm_sec, tm->tm_year,\ tm->tm_min, tm->tm_wday, tm->tm_hour, tm->tm_yday,\ - tm->tm_mday, tm->tm_isdst,tm->tm_mon) + tm->tm_mday, tm->tm_isdst, tm->tm_mon) #endif #define ZERO_tm( _X ) \ @@ -2933,9 +2933,9 @@ to_timestamp(PG_FUNCTION_ARGS) # elif defined(HAVE_INT_TIMEZONE) # ifdef __CYGWIN__ - tz = (tm->tm_isdst ? (_timezone - 3600) : _timezone); + tz = ((tm->tm_isdst > 0) ? (_timezone - 3600) : _timezone); # else - tz = (tm->tm_isdst ? (timezone - 3600) : timezone); + tz = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone); # endif # endif |