* ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary
authorArt Cancro <ajc@citadel.org>
Sat, 28 Dec 2002 05:33:29 +0000 (05:33 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 28 Dec 2002 05:33:29 +0000 (05:33 +0000)
  timezone.  Presumably this means the time was already UTC, and we really
  need that "Z" to get slapped on it.

citadel/ChangeLog
citadel/ical_dezonify.c

index 08c6c3bf2e4730932c77e5858644256ed8898776..804b20692994270e5df20e3bc5d9458f685bb452 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 601.99  2002/12/28 05:33:29  ajc
+ * ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary
+   timezone.  Presumably this means the time was already UTC, and we really
+   need that "Z" to get slapped on it.
+
  Revision 601.98  2002/12/28 05:12:06  ajc
  * Yet another attempt at making ical_dezonify() send outgoing calendar items
    in UTC format.  (This one will probably work -- the timestamps have the
@@ -4337,3 +4342,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index f7ead4e3da53940210662f2876cd134cb8152fa9..a0801e08b8c97ee23988354987e10f63e2965910 100644 (file)
@@ -38,7 +38,7 @@ void ical_dezonify_backend(icalcomponent *cal,
                        icalcomponent *rcal,
                        icalproperty *prop) {
 
-       icaltimezone *t;
+       icaltimezone *t = NULL;
        icalparameter *param;
        const char *tzid;
        struct icaltimetype TheTime;
@@ -48,15 +48,17 @@ void ical_dezonify_backend(icalcomponent *cal,
 
        /* Hunt for a TZID parameter in this property. */
        param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER);
-       if (param == NULL) return;
 
        /* Get the stringish name of this TZID. */
-       tzid = icalparameter_get_tzid(param);
-       if (tzid == NULL) return;
+       if (param != NULL) {
+               tzid = icalparameter_get_tzid(param);
 
-       /* Convert it to an icaltimezone type. */
-       t = icalcomponent_get_timezone(cal, tzid);
-       if (t == NULL) return;
+               /* Convert it to an icaltimezone type. */
+               if (tzid != NULL) {
+                       t = icalcomponent_get_timezone(cal, tzid);
+               }
+
+       }
 
        /* Now we know the timezone.  Convert to UTC. */
 
@@ -77,10 +79,12 @@ void ical_dezonify_backend(icalcomponent *cal,
        }
 
        /* Do the conversion. */
-       icaltimezone_convert_time(&TheTime,
-                               t,
-                               icaltimezone_get_utc_timezone()
-       );
+       if (t != NULL) {
+               icaltimezone_convert_time(&TheTime,
+                                       t,
+                                       icaltimezone_get_utc_timezone()
+               );
+       }
        TheTime.is_utc = 1;
        icalproperty_remove_parameter_by_kind(prop, ICAL_TZID_PARAMETER);