summaryrefslogtreecommitdiff
path: root/ext/date/lib/timelib.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2010-08-30 15:32:09 (GMT)
committerDerick Rethans <derick@php.net>2010-08-30 15:32:09 (GMT)
commitab6789a0eff4f1c4ae86fc038a53be87abca1efb (patch)
treedfa9721729dc8ff30332dff07761da117e585fb2 /ext/date/lib/timelib.c
parentd5a12aef12b5aa426ad83e58c6238ee447bd54fb (diff)
downloadphp-ab6789a0eff4f1c4ae86fc038a53be87abca1efb.tar.gz
- Fixed bug #52668 (Iterating over a dateperiod twice is broken).
Diffstat (limited to 'ext/date/lib/timelib.c')
-rw-r--r--ext/date/lib/timelib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 727e667..528c89d 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -46,6 +46,19 @@ timelib_rel_time* timelib_rel_time_ctor(void)
return t;
}
+timelib_time* timelib_time_clone(timelib_time *orig)
+{
+ timelib_time *tmp = timelib_time_ctor();
+ memcpy(tmp, orig, sizeof(timelib_time));
+ if (orig->tz_abbr) {
+ tmp->tz_abbr = strdup(orig->tz_abbr);
+ }
+ if (orig->tz_info) {
+ tmp->tz_info = orig->tz_info;
+ }
+ return tmp;
+}
+
timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel)
{
timelib_rel_time *tmp = timelib_rel_time_ctor();