aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2006-08-26 18:36:09 +0000
committerGuy Harris <guy@alum.mit.edu>2006-08-26 18:36:09 +0000
commita28b428afffadcca07a575306c68a3710a306610 (patch)
tree66a666f308ad70da58187b19ba600bb34cd0b55c /capture_opts.c
parent14be5e2bcc15c3c9d6717c12f395d820eb57c176 (diff)
Go back to setting the capture filter to an empty string when we start;
that obviates the need to check for a null capture filter string, and fixes bug 1055. Keep track of whether it was set from the command line, though, so we can catch attempts to set the filter more than once, and attempts to set it when we're not capturing. Clean up white space. svn path=/trunk/; revision=19047
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 28d9488f99..70bccc2d6f 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -52,7 +52,7 @@ void
capture_opts_init(capture_options *capture_opts, void *cfile)
{
capture_opts->cf = cfile;
- capture_opts->cfilter = NULL; /* No capture filter string specified */
+ capture_opts->cfilter = g_strdup(""); /* No capture filter string specified */
capture_opts->iface = NULL; /* Default is "pick the first interface" */
#ifdef _WIN32
capture_opts->buffer_size = 1; /* 1 MB */
@@ -325,10 +325,11 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg,
capture_opts->autostop_packets = get_positive_int(optarg, "packet count");
break;
case 'f': /* capture filter */
- if (capture_opts->cfilter) {
+ if (capture_opts->has_cfilter) {
cmdarg_err("More than one -f argument specified");
return 1;
}
+ capture_opts->has_cfilter = TRUE;
capture_opts->cfilter = g_strdup(optarg);
break;
case 'H': /* Hide capture info dialog box */