diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-04-19 23:06:23 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-04-19 23:06:23 +0000 |
commit | 4caa331d219bfd16bf2183221655aec1d50bf17f (patch) | |
tree | fd8463dfff8c52289864c3eb03c4c1b10c7430bf /epan/proto.c | |
parent | 0fa45bb541cd927ff1fd8b5cb3f8f4535d0e1b50 (diff) | |
download | wireshark-4caa331d219bfd16bf2183221655aec1d50bf17f.tar.gz wireshark-4caa331d219bfd16bf2183221655aec1d50bf17f.tar.bz2 wireshark-4caa331d219bfd16bf2183221655aec1d50bf17f.zip |
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.
svn path=/trunk/; revision=3335
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 26 |
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); |