From 92f514b081feeaef0ba2f6d6f70fef84e3995e5a Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sat, 14 Feb 2015 11:33:56 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- parse-xml.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'parse-xml.c') 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); -- cgit v1.2.3-70-g09d2