[evolution-patches] 55984



I did it this way to avoid fiddling with the prototype.

-JP
-- 
JP Rosevear <jpr ximian com>
Ximian, Inc.
? compile.patch
? src/libicalss/icalssyacc.output
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libical/ChangeLog,v
retrieving revision 1.161
diff -u -r1.161 ChangeLog
--- ChangeLog	26 Feb 2004 20:25:49 -0000	1.161
+++ ChangeLog	1 Apr 2004 21:23:54 -0000
@@ -1,3 +1,10 @@
+2004-04-01  JP Rosevear <jpr ximian com>
+
+	Fixes #55984
+	
+	* src/libical/icaltime.c (icaltime_as_timet_with_zone): copy the
+	icaltimetype to a local struct and use that
+
 2004-02-26  JP Rosevear <jpr ximian com>
 
 	* configure.in: don't ac_output python and java dirs
Index: src/libical/icaltime.c
===================================================================
RCS file: /cvs/gnome/libical/src/libical/icaltime.c,v
retrieving revision 1.30
diff -u -r1.30 icaltime.c
--- src/libical/icaltime.c	9 Jan 2004 14:55:41 -0000	1.30
+++ src/libical/icaltime.c	1 Apr 2004 21:23:54 -0000
@@ -189,7 +189,7 @@
        for this. */
     t = *(gmtime(&tm));
      
-    tt.year   = t.tm_year + 1900;
+     tt.year   = t.tm_year + 1900;
     tt.month  = t.tm_mon + 1;
     tt.day    = t.tm_mday;
     tt.hour   = t.tm_hour;
@@ -361,7 +361,8 @@
     struct tm stm;
     time_t t;
     char *old_tz;
-
+    struct icaltimetype local_tt;
+    
     utc_zone = icaltimezone_get_utc_timezone ();
 
     /* If the time is the special null time, return 0. */
@@ -369,21 +370,23 @@
 	return 0;
     }
 
+    local_tt = tt;
+    
     /* Clear the is_date flag, so we can convert the time. */
-    tt.is_date = 0;
+    local_tt.is_date = 0;
 
     /* Use our timezone functions to convert to UTC. */
-    icaltimezone_convert_time (&tt, zone, utc_zone);
+    icaltimezone_convert_time (&local_tt, zone, utc_zone);
 
     /* Copy the icaltimetype to a struct tm. */
     memset (&stm, 0, sizeof (struct tm));
 
-    stm.tm_sec = tt.second;
-    stm.tm_min = tt.minute;
-    stm.tm_hour = tt.hour;
-    stm.tm_mday = tt.day;
-    stm.tm_mon = tt.month-1;
-    stm.tm_year = tt.year-1900;
+    stm.tm_sec = local_tt.second;
+    stm.tm_min = local_tt.minute;
+    stm.tm_hour = local_tt.hour;
+    stm.tm_mday = local_tt.day;
+    stm.tm_mon = local_tt.month-1;
+    stm.tm_year = local_tt.year-1900;
     stm.tm_isdst = -1;
 
     /* Set TZ to UTC and use mktime to convert to a time_t. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]