From 0565f1d0f39d6066a8a970d1dd4c96a0281887b8 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 17 May 2017 09:31:33 +0200 Subject: [PATCH] update desc on changed .otrw files closes #171 --- storage.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/storage.c b/storage.c index 666e2eb..9395c28 100644 --- a/storage.c +++ b/storage.c @@ -1528,8 +1528,6 @@ static bool load_otrw_waypoints(struct udata *ud, JsonNode *wplist, char *user, { JsonNode *n; static UT_string *key; - long len; - char buf[20]; json_foreach(n, wplist) { JsonNode *rad, *lat, *lon, *desc, *tst, *type; @@ -1569,10 +1567,12 @@ static bool load_otrw_waypoints(struct udata *ud, JsonNode *wplist, char *user, */ /* Note: we don't need buf -- just checking if key exists */ - len = gcache_get(ud->wpdb, UB(key), buf, sizeof(buf)); - if (len == -1) { - gcache_json_put(ud->wpdb, UB(key), n); - } + // len = gcache_get(ud->wpdb, UB(key), buf, sizeof(buf)); + // if (len == -1) { + // } + + /* Clobber existing record b/c desc might have changed (#171) */ + gcache_json_put(ud->wpdb, UB(key), n); } return (true); @@ -1648,7 +1648,6 @@ bool load_fences(struct udata *ud) for (n = 0; n < results.gl_pathc; n++) { char *f = results.gl_pathv[n]; - // puts(f); load_otrw_file(ud, f); } }