summaryrefslogtreecommitdiff
path: root/navit/maps.c
diff options
context:
space:
mode:
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-09-21 21:45:56 +0000
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>2012-09-21 21:45:56 +0000
commit36eac38f786dcc4bdce811ef6c4ebfede270fad7 (patch)
tree4c6f9d00cf8d3cb6071bc6d3b8d96fd6597d8618 /navit/maps.c
parente49cf123fa0d4c657b8d7f15dc36c22aa695e0a3 (diff)
downloadnavit-36eac38f786dcc4bdce811ef6c4ebfede270fad7.tar.gz
Fix:Android:Fix map unloading
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5233 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/maps.c')
-rw-r--r--navit/maps.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/navit/maps.c b/navit/maps.c
index 84b34168c..afc78feea 100644
--- a/navit/maps.c
+++ b/navit/maps.c
@@ -46,12 +46,31 @@ maps_new(struct attr *parent, struct attr **attrs)
struct file_wordexp *wexp=file_wordexp_new(data->u.str);
int i,count=file_wordexp_get_count(wexp);
char **array=file_wordexp_get_array(wexp);
+ struct attr *name;
+ struct attr *name_provided = attr_search(attrs_dup, NULL, attr_name);
+
+ // if no name was provided, fill the name with the location
+ if (!name_provided) {
+ struct attr name_tmp;
+ name_tmp.type = attr_name;
+ name_tmp.u.str="NULL";
+ attrs_dup=attr_list_append(attrs_dup, &name_tmp);
+ name = attr_search(attrs_dup, NULL, attr_name);
+ }
+
for (i = 0 ; i < count ; i++) {
struct attr map;
g_free(data->u.str);
data->u.str=g_strdup(array[i]);
+
+ if (!name_provided) {
+ g_free(name->u.str);
+ name->u.str=g_strdup(array[i]);
+ }
+
map.type=attr_map;
map.u.map=map_new(parent, attrs_dup);
+
if (map.u.map) {
mapset_add_attr(parent->u.mapset, &map);
map_unref(map.u.map);