<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 14, 2015 at 8:46 PM, Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">oops, this messages got stuck in my outbox...<br>
<br>
/D<br>
<span class=""><br>
On Sat, Feb 14, 2015 at 11:33:56AM +0200, Miika Turkia wrote:<br>
> If the dive site exists, we need to associate the uuid to current dive.<br>
><br>
> Signed-off-by: Miika Turkia <<a href="mailto:miika.turkia@gmail.com">miika.turkia@gmail.com</a>><br>
> ---<br>
>  parse-xml.c | 4 ++++<br>
>  1 file changed, 4 insertions(+)<br>
><br>
> diff --git a/parse-xml.c b/parse-xml.c<br>
> index cfe3459..97d0c09 100644<br>
> --- a/parse-xml.c<br>
> +++ b/parse-xml.c<br>
> @@ -1226,6 +1226,10 @@ static void add_dive_site(char *buffer, struct dive *dive)<br>
>                       } else if (!same_string(ds->name, buffer)) {<br>
>                               // coin toss, let's just keep the first name we found<br>
>                               fprintf(stderr, "which means the dive already links to dive site of different name {%s} / {%s}\n", ds->name, buffer);<br>
> +                     } else {<br>
> +                             // add the existing dive site to the current dive<br>
> +                             fprintf(stderr, "we have an existing location, using {%s}\n", ds->name);<br>
> +                             dive->dive_site_uuid = uuid;<br>
<br>
</span>Read the beginning of the function... if I'm not mistaken, ds is created<br>
from dive->dive_site_uuid... so there should be no reason to set it again.<br>
Am I missing something?<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>The attached log (2 dives) has same sites for both of the dives, but opening it with current master does loose one of the locations. This occurs during the conversion from old format, thus there is no uuid for the dive currently being parsed. So we get the uuid by the site name, but never assign that to the dive in case of duplicate location.<br><br>miika<br></div></div><br></div></div>