summaryrefslogtreecommitdiff
path: root/navit/maptool/itembin.c
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-02-17 19:35:31 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-02-17 19:35:31 +0000
commit3356bf656bf970dfe4266f24670e18824cf16e2e (patch)
treebc9af8ff1cca8122757e64cbf2aa1de38b6bc285 /navit/maptool/itembin.c
parent50716fef4afc508855048c1ee61f13201db64060 (diff)
downloadnavit-3356bf656bf970dfe4266f24670e18824cf16e2e.tar.gz
Fix:maptool:Really remove duplicate of attribute used as key (redo svn5372).
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5383 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/maptool/itembin.c')
-rw-r--r--navit/maptool/itembin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/navit/maptool/itembin.c b/navit/maptool/itembin.c
index 4d6a68cf9..5c31392f7 100644
--- a/navit/maptool/itembin.c
+++ b/navit/maptool/itembin.c
@@ -473,10 +473,12 @@ void
item_bin_write_match(struct item_bin *ib, enum attr_type type, enum attr_type match, int maxdepth, FILE *out)
{
char *word=item_bin_get_attr(ib, type, NULL);
- int i,words=0,len=ib->len;
+ int i,words=0,len;
char tilename[32]="";
+
if (!word)
return;
+
if(maxdepth && ib->clen>0) {
struct rect r;
struct coord *c=(struct coord *)(ib+1);
@@ -489,14 +491,12 @@ item_bin_write_match(struct item_bin *ib, enum attr_type type, enum attr_type ma
/* insert attr_tile_name attribute before the attribute used as alphabetical key (of type type) */
if(maxdepth) {
- struct attr_bin *a=item_bin_get_attr_bin(ib, type, NULL);
- char *s=g_strdup((char*)(a+1));
- item_bin_remove_attr(ib,a);
item_bin_add_attr_string(ib, attr_tile_name, tilename);
- item_bin_add_attr_string(ib, type, s);
- g_free(s);
- len=ib->len;
+ item_bin_add_attr_string(ib, type, word);
+ item_bin_remove_attr(ib,word);
+ word=item_bin_get_attr(ib, type, NULL);
}
+ len=ib->len;
do {
if (linguistics_search(word)) {
for (i = 0 ; i < 3 ; i++) {