Ethereal-dev: Re: [Ethereal-dev] Patch for -R command line handling

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 8 May 2001 16:38:11 -0700 (PDT)
> attched patch fixes what I assume to be a bug in the handling of the
> -R command line argument in both ethereal and thethereal.

I'm not sure why there's a bug - "rfilter" is a variable local to
"main()" in both cases, and it's only used as an argument to
"dfilter_compile()", which, though a chain of calls, passes it
eventually to "yy_scan_string()", which, as per the Flex manual, makes a
copy of it anyway.

*Other* string arguments may be assigned to more global variables, and
the strings pointed to those more global variables may be freed, so that
they must have a copy allocated by "g_strdup()" - but it's not the case
that *all* string arguments to Ethereal or Tethereal necessarily must be
"g_strdup()"ed.