diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 23:52:41 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 23:52:41 -0800 |
commit | 56de6b73f67d5ddeec74153303a27866e39279c7 (patch) | |
tree | 45040e1fb23c26e12b3002e9381f13717a9eb78d /divelist.c | |
parent | 2843dc38c9e64e87ac1ee84e2cb0147f630ab117 (diff) | |
parent | f81e2c111d9c563a78e62c3bae64bec07c052ec0 (diff) | |
download | subsurface-56de6b73f67d5ddeec74153303a27866e39279c7.tar.gz |
Merge branch 'divesites'
This brings in the dive site infrastructure and initial UI work
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/divelist.c b/divelist.c index f1dd7006c..d57188a68 100644 --- a/divelist.c +++ b/divelist.c @@ -678,9 +678,9 @@ void add_dive_to_trip(struct dive *dive, dive_trip_t *trip) dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive) { dive_trip_t *dive_trip = calloc(1, sizeof(dive_trip_t)); + dive_trip->when = dive->when; - if (dive->location) - dive_trip->location = strdup(dive->location); + dive_trip->location = copy_string(get_dive_location(dive)); insert_trip(&dive_trip); dive->tripflag = IN_TRIP; @@ -713,8 +713,8 @@ void autogroup_dives(void) if (lastdive && dive->when < lastdive->when + TRIP_THRESHOLD) { dive_trip_t *trip = lastdive->divetrip; add_dive_to_trip(dive, trip); - if (dive->location && !trip->location) - trip->location = strdup(dive->location); + if (get_dive_location(dive) && !trip->location) + trip->location = copy_string(get_dive_location(dive)); lastdive = dive; continue; } @@ -745,7 +745,6 @@ void delete_single_dive(int idx) dive_table.dives[--dive_table.nr] = NULL; /* free all allocations */ free(dive->dc.sample); - free((void *)dive->location); free((void *)dive->notes); free((void *)dive->divemaster); free((void *)dive->buddy); |