summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-02-02 18:45:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-02 09:17:28 -0800
commitbbc3a0e55fd1ebf98ba4b79b6115ab115f1b47a3 (patch)
tree9130861d9ec1d43cb5c98853746327192a345716
parentb71ee970dbd689cf810226805fc7ffdf796826af (diff)
downloadsubsurface-bbc3a0e55fd1ebf98ba4b79b6115ab115f1b47a3.tar.gz
Do not reorder pictures when saving
When one has 2 pictures with the same timestamp, these pictures are reordered on saving (requires something changed on the specific dive for the save to actually trigger). This patch keeps the picture order intact in the XML log. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index ce7619e85..7b3ab21ef 100644
--- a/dive.c
+++ b/dive.c
@@ -2870,7 +2870,7 @@ void dive_add_picture(struct dive *d, struct picture *newpic)
{
struct picture **pic_ptr = &d->picture_list;
/* let's keep the list sorted by time */
- while (*pic_ptr && (*pic_ptr)->offset.seconds < newpic->offset.seconds)
+ while (*pic_ptr && (*pic_ptr)->offset.seconds <= newpic->offset.seconds)
pic_ptr = &(*pic_ptr)->next;
newpic->next = *pic_ptr;
*pic_ptr = newpic;