Fix for bug 1023 (problem with 'apply as filter' strings)
authormartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 2 Aug 2006 09:14:31 +0000 (09:14 +0000)
committermartinm <martinm@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 2 Aug 2006 09:14:31 +0000 (09:14 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18817 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c

index 51cd35be86d13239d44fe47b341aee3159a8be6b..1c94aa374f1884a68924464b69297ca350ca797b 100644 (file)
@@ -5291,8 +5291,6 @@ proto_construct_dfilter_string(field_info *finfo, epan_dissect_t *edt)
                        break;
 
                case FT_PROTOCOL:
-               case FT_NONE:
-                       /* Just want to test for the presence of these */
                        buf = ep_strdup(finfo->hfinfo->abbrev);
                        break;
 
@@ -5322,13 +5320,18 @@ proto_construct_dfilter_string(field_info *finfo, epan_dissect_t *edt)
                                return NULL;    /* you lose */
 
                        /*
-                        * If the length is 0, there's nothing to match, so
-                        * we can't match.  (Also check for negative values,
+                        * If the length is 0, just match the name of the field
+                        * (Also check for negative values,
                         * just in case, as we'll cast it to an unsigned
                         * value later.)
                         */
                        length = finfo->length;
-                       if (length <= 0)
+                       if (length == 0)
+                       {
+                               buf = ep_strdup(finfo->hfinfo->abbrev);
+                               break;
+                       }
+                       if (length < 0)
                                return NULL;
 
                        /*