Merge lp:~davidagraf/zorba/lastmodifiedfix into lp:zorba

Proposed by David Graf
Status: Merged
Approved by: Ghislain Fourny
Approved revision: 11022
Merged at revision: 11027
Proposed branch: lp:~davidagraf/zorba/lastmodifiedfix
Merge into: lp:zorba
Diff against target: 37 lines (+11/-2)
2 files modified
ChangeLog (+1/-0)
modules/org/expath/ns/file.xq.src/file.cpp (+10/-2)
To merge this branch: bzr merge lp:~davidagraf/zorba/lastmodifiedfix
Reviewer Review Type Date Requested Status
Ghislain Fourny Approve
David Graf (community) Approve
Review via email: mp+123494@code.launchpad.net

Commit message

To post a comment you must log in.
Revision history for this message
David Graf (davidagraf) :
review: Approve
Revision history for this message
Ghislain Fourny (gislenius) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job lastmodifiedfix-2012-09-10T09-08-49.168Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-09-09 07:46:57 +0000
3+++ ChangeLog 2012-09-10 07:14:24 +0000
4@@ -26,6 +26,7 @@
5 * Fixed bug #1042840 (qname pool free-list corruption)
6 * Fixed bug #866984 (better error message for an eval error)
7 * Fixed bug #932884 (HTML and XHTML serialization of empty elements)
8+ * Fixed bug #1045902 (file:last-modified returns current date time)
9
10 version 2.6
11
12
13=== modified file 'modules/org/expath/ns/file.xq.src/file.cpp'
14--- modules/org/expath/ns/file.xq.src/file.cpp 2012-08-30 13:45:43 +0000
15+++ modules/org/expath/ns/file.xq.src/file.cpp 2012-09-10 07:14:24 +0000
16@@ -603,11 +603,19 @@
17 // actual last modified
18 try {
19 time_t lTime = lFile->lastModified();
20- struct tm *lT = localtime(&lTime);
21+ // result of localtime needs to be copied.
22+ // Otherwise, nasty side effecs do happen
23+ struct tm lT(*localtime(&lTime));
24 int gmtOffset = LastModifiedFunction::getGmtOffset();
25
26 return ItemSequence_t(new SingletonItemSequence(
27- theModule->getItemFactory()->createDateTime(1900 + lT->tm_year, lT->tm_mon, lT->tm_mday, lT->tm_hour, lT->tm_min, lT->tm_sec, gmtOffset)));
28+ theModule->getItemFactory()->createDateTime(1900 + lT.tm_year,
29+ lT.tm_mon,
30+ lT.tm_mday,
31+ lT.tm_hour,
32+ lT.tm_min,
33+ lT.tm_sec,
34+ gmtOffset)));
35 } catch (ZorbaException& ze) {
36 std::stringstream lSs;
37 lSs << "An unknown error occured: " << ze.what() << "Can not retrieve the last modification timestamp of";

Subscribers

People subscribed via source and target branches