summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-02-14 11:33:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-14 11:37:33 -0800
commit92f514b081feeaef0ba2f6d6f70fef84e3995e5a (patch)
treebdf7f9a464124ac288f1c8f17a9c159d7df39d32 /parse-xml.c
parent961bac9233e1e727760ff5522bd541bd8a5b540d (diff)
downloadsubsurface-92f514b081feeaef0ba2f6d6f70fef84e3995e5a.tar.gz
Associate existing dive site to current dive
If the dive site exists, we need to associate the uuid to current dive. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index cfe3459ed..97d0c090f 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1226,6 +1226,10 @@ static void add_dive_site(char *buffer, struct dive *dive)
} else if (!same_string(ds->name, buffer)) {
// coin toss, let's just keep the first name we found
fprintf(stderr, "which means the dive already links to dive site of different name {%s} / {%s}\n", ds->name, buffer);
+ } else {
+ // add the existing dive site to the current dive
+ fprintf(stderr, "we have an existing location, using {%s}\n", ds->name);
+ dive->dive_site_uuid = uuid;
}
} else {
fprintf(stderr, "no uuid, create new dive site with name {%s}\n", buffer);