Match Selected works better with FT_STRING variables.
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 15 Dec 2000 13:53:11 +0000 (13:53 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 15 Dec 2000 13:53:11 +0000 (13:53 +0000)
From Ed Warnicke <hagbard@physics.rutgers.edu>

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2763 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/main.c

index 26f2a8d99ecf86a123354e1ca33e3f5c20ee784d..1238f0bd6d39d31e8662a6997d740581158c501e 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c
  *
- * $Id: main.c,v 1.167 2000/12/03 22:12:21 guy Exp $
+ * $Id: main.c,v 1.168 2000/12/15 13:53:11 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -251,15 +251,20 @@ match_selected_cb(GtkWidget *w, gpointer data)
                                sizeof(struct timeval));
                        break;
 
-               case FT_STRING:
-                       /* This g_strdup'ed memory is freed in proto_tree_free_node() */
-                       fi->value.string = g_strdup(va_arg(ap, char*));
-                       break;
-
                case FT_TEXT_ONLY:
                        ; /* nothing */
                        break;
 #endif
+
+               case FT_STRING:
+                       dfilter_len = abbrev_len + 
+                         strlen(finfo_selected->value.string) + 7;
+                       buf = g_malloc0(dfilter_len);
+                       snprintf(buf, dfilter_len, "%s == \"%s\"",
+                                hfinfo->abbrev,
+                                finfo_selected->value.string);
+                       break;
+
                default:
                    c = cfile.pd + finfo_selected->start;
                    buf = g_malloc0(32 + finfo_selected->length * 3);