Skip to content
Browse files

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>
  • Loading branch information...
1 parent cfb1baa commit a544d74044d4e3ffa609ab734dc69eb25d6d9c52 @dirkhh dirkhh committed Sep 29, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 dive.c
View
7 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);

0 comments on commit a544d74

Please sign in to comment.
Something went wrong with that request. Please try again.