summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 6bbb72e1e..e4ad78cb9 100644
--- a/dive.c
+++ b/dive.c
@@ -341,9 +341,13 @@ void copy_dive(struct dive *s, struct dive *d)
d->location = copy_string(s->location);
d->notes = copy_string(s->notes);
d->suit = copy_string(s->suit);
- STRUCTURED_LIST_COPY(struct divecomputer, s->dc.next, d->dc.next, copy_dc);
STRUCTURED_LIST_COPY(struct picture, s->picture_list, d->picture_list, copy_pl);
STRUCTURED_LIST_COPY(struct tag_entry, s->tag_list, d->tag_list, copy_tl);
+ STRUCTURED_LIST_COPY(struct divecomputer, s->dc.next, d->dc.next, copy_dc);
+ /* this only copied dive computers 2 and up. The first dive computer is part
+ * of the struct dive, so let's make copies of its samples and events */
+ copy_samples(&s->dc, &d->dc);
+ copy_events(&s->dc, &d->dc);
}
/* make a clone of the source dive and clean out the source dive;