aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-04-19 23:06:23 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-04-19 23:06:23 +0000
commitdfc8dc0edaa3d451231060f76da318b3f96b092c (patch)
treefd8463dfff8c52289864c3eb03c4c1b10c7430bf /epan
parente296f875c22c81c0663fc06db14f4937111719d7 (diff)
Patch from Ronnie Sahlberg to cause the field description section of the
status bar to display nothing, rather than "Text (text)", when a "proto_tree_add_text()" field is selected. While we're at it, use a similar test to eliminate the text pseudo-field from the output of "{ethereal,tethereal} -G", as well. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3335 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r--epan/proto.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 381885b6b8..5e828121a8 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
- * $Id: proto.c,v 1.21 2001/04/10 19:10:10 guy Exp $
+ * $Id: proto.c,v 1.22 2001/04/19 23:06:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -168,8 +168,8 @@ proto_init(const char *plugin_dir,void (register_all_protocols)(void),
{
static hf_register_info hf[] = {
{ &hf_text_only,
- { "Text", "text", FT_NONE, BASE_NONE, NULL, 0x0,
- "" }},
+ { "", "", FT_NONE, BASE_NONE, NULL, 0x0,
+ NULL }},
};
if (gmc_hfinfo)
@@ -2708,6 +2708,26 @@ proto_registrar_dump(void)
for (i = 0; i < len ; i++) {
hfinfo = proto_registrar_get_nth(i);
+ /*
+ * Skip fields with zero-length names or abbreviations;
+ * the pseudo-field for "proto_tree_add_text()" is such
+ * a field, and we don't want it in the list of filterable
+ * fields.
+ *
+ *
+ * XXX - perhaps the name and abbrev field should be null
+ * pointers rather than null strings for that pseudo-field,
+ * but we'd have to add checks for null pointers in some
+ * places if we did that.
+ *
+ * Or perhaps protocol tree items added with
+ * "proto_tree_add_text()" should have -1 as the field index,
+ * with no pseudo-field being used, but that might also
+ * require special checks for -1 to be added.
+ */
+ if (strlen(hfinfo->name) == 0 || strlen(hfinfo->abbrev) == 0)
+ continue;
+
/* format for protocols */
if (proto_registrar_is_protocol(i)) {
printf("P\t%s\t%s\n", hfinfo->name, hfinfo->abbrev);