From d70f25040654163f0056b17b320c843e2edd6328 Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Wed, 26 Sep 2012 12:54:46 +0000 Subject: [PATCH] Revision 45146 fixed only the first map. This patch fixes all maps. #BACKPORT(1.6, 1.8) svn path=/trunk/; revision=45148 --- ui/gtk/hostlist_table.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ui/gtk/hostlist_table.c b/ui/gtk/hostlist_table.c index 2f3e9f73f7..85866ddcf6 100644 --- a/ui/gtk/hostlist_table.c +++ b/ui/gtk/hostlist_table.c @@ -932,12 +932,19 @@ typedef struct { hostlist_table *talkers; } map_t; +static char *map_endpoint_opener; + +static void +map_init(void) +{ + map_endpoint_opener = "{\n"; +} + /* XXX output in C locale */ static gboolean map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, gpointer data) { - static char *opener = "{\n"; map_t *map = (map_t *)data; gchar *table_entry, *esc_entry; guint64 value; @@ -963,7 +970,7 @@ map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, }, */ - fputs(opener, map->out_file); + fputs(map_endpoint_opener, map->out_file); fputs(" 'type': 'Feature', 'geometry': { 'type': 'Point', 'coordinates': [", map->out_file); /* Longitude */ @@ -1029,7 +1036,7 @@ map_handle(GtkTreeModel *model, GtkTreePath *path _U_, GtkTreeIter *iter, fputs("' }\n", map->out_file); fputs("}", map->out_file); - opener = ",\n{\n"; + map_endpoint_opener = ",\n{\n"; map->hosts_written = TRUE; @@ -1142,6 +1149,7 @@ open_as_map_cb(GtkWindow *copy_bt, gpointer data _U_) fputs(tpl_line, map.out_file); /* MUST match ipmap.html */ if (strstr(tpl_line, "// Start endpoint list")) { + map_init(); gtk_tree_model_foreach(GTK_TREE_MODEL(store), map_handle, &map); } }