diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2017-09-10 10:53:45 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-11 07:19:57 -0700 |
commit | d7c89a79f81653e45907a13f3d802a6df9a2aad4 (patch) | |
tree | d0daf90f961a7a9d3f53c03bc0774f90f5e7e0f1 /core | |
parent | 15ef53fb805a96fec1dd9358ce58bcef6de9baab (diff) | |
download | subsurface-d7c89a79f81653e45907a13f3d802a6df9a2aad4.tar.gz |
Do not save duration if it is zero
See #561
Diffstat (limited to 'core')
-rw-r--r-- | core/save-git.c | 3 | ||||
-rw-r--r-- | core/save-xml.c | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/save-git.c b/core/save-git.c index 8b555c191..548664239 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -424,7 +424,8 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer */ static void create_dive_buffer(struct dive *dive, struct membuffer *b) { - put_format(b, "duration %u:%02u min\n", FRACTION(dive->dc.duration.seconds, 60)); + if (dive->dc.duration.seconds > 0) + put_format(b, "duration %u:%02u min\n", FRACTION(dive->dc.duration.seconds, 60)); SAVE("rating", rating); SAVE("visibility", visibility); cond_put_format(dive->tripflag == NO_TRIP, b, "notrip\n"); diff --git a/core/save-xml.c b/core/save-xml.c index f7564f4b1..84530a749 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -457,8 +457,11 @@ void save_one_dive_to_mb(struct membuffer *b, struct dive *dive) fprintf(stderr, "removed reference to non-existant dive site with uuid %08x\n", dive->dive_site_uuid); } show_date(b, dive->when); - put_format(b, " duration='%u:%02u min'>\n", - FRACTION(dive->dc.duration.seconds, 60)); + if (dive->dc.duration.seconds > 0) + put_format(b, " duration='%u:%02u min'>\n", + FRACTION(dive->dc.duration.seconds, 60)); + else + put_format(b, ">\n"); save_overview(b, dive); save_cylinder_info(b, dive); save_weightsystem_info(b, dive); |