summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-29 16:18:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-29 16:18:19 -0700
commita544d74044d4e3ffa609ab734dc69eb25d6d9c52 (patch)
tree11dc0a00800fd74db93132e7e89a56b9ba2f9a99
parentcfb1baa030c0fd0d20e3d47e03940b7e7f3f7809 (diff)
downloadsubsurface-a544d74044d4e3ffa609ab734dc69eb25d6d9c52.tar.gz
Correctly handle merging dives that are part of a trip
If we have already created a dive_trip structure we need to also copy the link. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index b1739ad80..092153d8d 100644
--- a/dive.c
+++ b/dive.c
@@ -711,10 +711,13 @@ struct dive *try_to_merge(struct dive *a, struct dive *b)
res->when = a->when;
/* the larger tripflag is more relevant */
- if(a->tripflag > b->tripflag)
+ if(a->tripflag > b->tripflag) {
res->tripflag = a->tripflag;
- else
+ res->divetrip = a->divetrip;
+ } else {
res->tripflag = b->tripflag;
+ res->divetrip = b->divetrip;
+ }
MERGE_NONZERO(res, a, b, latitude);
MERGE_NONZERO(res, a, b, longitude);
MERGE_TXT(res, a, b, location);