diff options
author | Gerald Combs <gerald@wireshark.org> | 2008-01-31 19:50:38 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2008-01-31 19:50:38 +0000 |
commit | 9703c2bb75f8498f547c5a66b0c0aa8d922668ba (patch) | |
tree | dd8eb691d273e26190372f913f86209491f2776c /epan/dfilter/scanner.l | |
parent | f3747bf63786cac3ebc8e13621c688a0c0451970 (diff) | |
download | wireshark-9703c2bb75f8498f547c5a66b0c0aa8d922668ba.tar.gz |
If "!=" or "ne" are used in a display filter, warn the user that the results
may be unexpected.
svn path=/trunk/; revision=24232
Diffstat (limited to 'epan/dfilter/scanner.l')
-rw-r--r-- | epan/dfilter/scanner.l | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l index 6af7921798..8ce6d91d60 100644 --- a/epan/dfilter/scanner.l +++ b/epan/dfilter/scanner.l @@ -26,17 +26,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 2001 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -83,6 +83,7 @@ static int set_lval_int(int token, char *s); static int simple(int token); static gboolean str_to_gint32(char *s, gint32* pint); GString* quoted_string = NULL; +static void mark_lval_deprecated(const char *s); %} @@ -102,8 +103,14 @@ GString* quoted_string = NULL; "==" return simple(TOKEN_TEST_EQ); "eq" return simple(TOKEN_TEST_EQ); -"!=" return simple(TOKEN_TEST_NE); -"ne" return simple(TOKEN_TEST_NE); +"!=" { + mark_lval_deprecated("!="); + return simple(TOKEN_TEST_NE); +} +"ne" { + mark_lval_deprecated("ne"); + return simple(TOKEN_TEST_NE); +} ">" return simple(TOKEN_TEST_GT); "gt" return simple(TOKEN_TEST_GT); ">=" return simple(TOKEN_TEST_GE); @@ -351,7 +358,7 @@ set_lval_int(int token, char *s) if (!str_to_gint32(s, &val)) { return SCAN_FAILED; - } + } switch (token) { case TOKEN_INTEGER: @@ -417,4 +424,10 @@ str_to_gint32(char *s, gint32* pint) return TRUE; } +static void +mark_lval_deprecated(const char *s) +{ + df_lval->deprecated_token = s; +} + #include <lemonflex-tail.inc> |