From c30dfba433eb6e46d88a0c25cea7c4f47cb55f33 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 3 Oct 2015 07:11:11 -0400 Subject: Don't delete the trip when splitting the only dive in a trip When splitting dives make sure the new dives first are part of the same trip the original dive was in. Signed-off-by: Dirk Hohndel --- dive.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dive.c b/dive.c index fb9c4cec7..321c9d166 100644 --- a/dive.c +++ b/dive.c @@ -2905,6 +2905,11 @@ static int split_dive_at(struct dive *dive, int a, int b) fixup_dive(d1); fixup_dive(d2); + if (dive->divetrip) { + d1->divetrip = d2->divetrip = 0; + add_dive_to_trip(d1, dive->divetrip); + add_dive_to_trip(d2, dive->divetrip); + } if ((i = get_divenr(dive)) < 0) return 0; -- cgit v1.2.3-70-g09d2