diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-10-22 12:42:09 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-22 09:07:27 -0400 |
commit | ee0fc25cf31050720f111266d39106d46306a21a (patch) | |
tree | ffe3961251fbecd630a06161769b9ce846e8bf2a /core/parse.c | |
parent | 9c6d24e50e223b62ce338ae4e802942c25da6872 (diff) | |
download | subsurface-ee0fc25cf31050720f111266d39106d46306a21a.tar.gz |
Parser: remove webservice related code
Recently, the subsurface webservice was removed. Remove the corresponding
code in the parser. This removes a static variable, which was used
to generate unique dive-site ids.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse.c')
-rw-r--r-- | core/parse.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/core/parse.c b/core/parse.c index 005a971e5..7135babb8 100644 --- a/core/parse.c +++ b/core/parse.c @@ -411,7 +411,6 @@ void utf8_string(char *buffer, void *_res) void add_dive_site(char *ds_name, struct dive *dive) { - static int suffix = 1; char *buffer = ds_name; char *to_free = NULL; int size = trimspace(buffer); @@ -426,18 +425,6 @@ void add_dive_site(char *ds_name, struct dive *dive) if (!uuid) { // if the dive doesn't have a uuid, check if there's already a dive site by this name uuid = get_dive_site_uuid_by_name(buffer, &ds); - if (uuid && import_source == SSRF_WS) { - // when downloading GPS fixes from the Subsurface webservice we will often - // get a lot of dives with identical names (the autogenerated fixes). - // So in this case modify the name to make it unique - int name_size = strlen(buffer) + 10; // 8 digits - enough for 100 million sites - to_free = buffer = malloc(name_size); - do { - suffix++; - snprintf(buffer, name_size, "%s %8d", ds_name, suffix); - } while (get_dive_site_uuid_by_name(buffer, NULL) != 0); - ds = NULL; - } } if (ds) { // we have a uuid, let's hope there isn't a different name |