1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-29 15:41:13 +03:00

applied patch from Peter Pawlowski fixing a timezone offset problem, fixes

* libexslt/date.c: applied patch from Peter Pawlowski  fixing
  a timezone offset problem, fixes #521680
* libxslt/namespaces.c: a bit of space/tabs cleanup
Daniel

svn path=/trunk/; revision=1462
This commit is contained in:
Daniel Veillard
2008-04-03 05:34:12 +00:00
parent 21aec4db49
commit f4ffd9fa72
4 changed files with 39 additions and 11 deletions

View File

@ -1,3 +1,9 @@
Thu Apr 3 07:32:36 CEST 2008 Daniel Veillard <daniel@veillard.com>
* libexslt/date.c: applied patch from Peter Pawlowski fixing
a timezone offset problem, fixes #521680
* libxslt/namespaces.c: a bit of space/tabs cleanup
Thu Apr 3 06:25:02 CEST 2008 Daniel Veillard <daniel@veillard.com>
* doc/xsltproc.xml doc/xsltproc.1 doc/xsltproc.html: small fix to

View File

@ -1,11 +1,11 @@
.\" Title: xsltproc
.\" Author: John Fleck <jfleck@inkstain.net>
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: $Date: 2008-03-03 09:42:08 +0100 (Mon, 03 Mar 2008) $
.\" Date: $Date: 2008-04-03 06:26:46 +0200 (Thu, 03 Apr 2008) $
.\" Manual: xsltproc Manual
.\" Source: libxslt
.\"
.TH "XSLTPROC" "1" "$Date: 2008\-03\-03 09:42:08 +0100 (Mon, 03 Mar 2008) $" "libxslt" "xsltproc Manual"
.TH "XSLTPROC" "1" "$Date: 2008\-04\-03 06:26:46 +0200 (Thu, 03 Apr 2008) $" "libxslt" "xsltproc Manual"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)

View File

@ -747,7 +747,8 @@ static exsltDateValPtr
exsltDateCurrent (void)
{
struct tm *localTm, *gmTm;
time_t secs, gsecs;
time_t secs;
int local_s, gm_s;
#if HAVE_LOCALTIME_R
struct tm localTmS;
#endif
@ -795,8 +796,29 @@ exsltDateCurrent (void)
((gmTm->tm_mday * 1440) + (gmTm->tm_hour * 60) +
gmTm->tm_min));
#endif
gsecs = mktime(gmTm);
ret->value.date.tzo = (secs - gsecs) / 60;
local_s = localTm->tm_hour * SECS_PER_HOUR +
localTm->tm_min * SECS_PER_MIN +
localTm->tm_sec;
gm_s = gmTm->tm_hour * SECS_PER_HOUR +
gmTm->tm_min * SECS_PER_MIN +
gmTm->tm_sec;
if (localTm->tm_year < gmTm->tm_year) {
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
} else if (localTm->tm_year > gmTm->tm_year) {
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
} else if (localTm->tm_mon < gmTm->tm_mon) {
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
} else if (localTm->tm_mon > gmTm->tm_mon) {
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
} else if (localTm->tm_mday < gmTm->tm_mday) {
ret->value.date.tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
} else if (localTm->tm_mday > gmTm->tm_mday) {
ret->value.date.tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
} else {
ret->value.date.tzo = (local_s - gm_s)/60;
}
return ret;
}