summaryrefslogtreecommitdiff
path: root/ui/gtk/hostlist_table.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-09-26 12:54:46 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-09-26 12:54:46 +0000
commitd70f25040654163f0056b17b320c843e2edd6328 (patch)
tree285cfc67ddbb0985b4503e3da670ad2d6e3ed3f4 /ui/gtk/hostlist_table.c
parent0b194f98ad9f74839fd13121a7a7974f5cac9aa2 (diff)
downloadwireshark-d70f25040654163f0056b17b320c843e2edd6328.tar.gz
Revision 45146 fixed only the first map. This patch fixes all maps.
#BACKPORT(1.6, 1.8) svn path=/trunk/; revision=45148
Diffstat (limited to 'ui/gtk/hostlist_table.c')
-rw-r--r--ui/gtk/hostlist_table.c14
1 files 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);
}
}