]> code.citadel.org Git - citadel.git/commitdiff
* Clone calendar subcomponents before encapsulating in case they already
authorArt Cancro <ajc@citadel.org>
Fri, 14 Mar 2003 05:08:25 +0000 (05:08 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 14 Mar 2003 05:08:25 +0000 (05:08 +0000)
  happen to have a parent.

citadel/ChangeLog
citadel/serv_calendar.c

index 85eee3f97296b66aca5f4f26ffcc7b1635177220..a0d8be630c71d3896b3c3fe5f70f8eef4a116055 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 605.16  2003/03/14 05:08:25  ajc
+ * Clone calendar subcomponents before encapsulating in case they already
+   happen to have a parent.
+
  Revision 605.15  2003/03/13 05:48:33  ajc
  * Move towards storing calendar objects as fully encapsulated VCALENDAR
    components instead of just VEVENT subcomponents.
@@ -4545,4 +4549,3 @@ 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 4fec5bdf1e9dfff65e0182791402b1d413fdefa1..84c99721b0c8f6ca3645527c887b51d3cef6a9d0 100644 (file)
@@ -97,6 +97,7 @@ void ical_write_to_cal(struct usersupp *u, icalcomponent *cal) {
        char temp[PATH_MAX];
        FILE *fp;
        char *ser;
+       icalcomponent *encaps;
 
        if (cal == NULL) return;
 
@@ -104,10 +105,11 @@ void ical_write_to_cal(struct usersupp *u, icalcomponent *cal) {
         * a full VCALENDAR component, and save that instead.
         */
        if (icalcomponent_isa(cal) != ICAL_VCALENDAR_COMPONENT) {
-               ical_write_to_cal(
-                       u,
-                       ical_encapsulate_subcomponent(cal)
+               encaps = ical_encapsulate_subcomponent(
+                       icalcomponent_new_clone(cal)
                );
+               ical_write_to_cal(u, encaps);
+               icalcomponent_free(encaps);
                return;
        }