Ethereal-dev: Re: [Ethereal-dev] Patch request for 'filters.c'

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

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Thu, 16 Feb 2006 23:45:23 +0100
Fabrizio Bertocci wrote:
Hi,
The patch attached modify the default behavior of the function 'read_filter_list' to attempt read cfilters/dfilters from the Ethereal data directory, in case no cfilters/dfilters are found in user's home directory.
That's already the case.
With this patch you can ship Ethereal with some predefined capture/display filters (you obviously still need to change the installer script to include those files).
We already do exactly this (at least for the Win32 build).
If you guys think it's a useful feature, can we integrate it in the development tree ?

--- ethereal-0.10.14.original/filters.c	2005-12-26 18:21:20.000000000 -0800
+++ ethereal-0.10.14.new/filters.c	2006-02-16 10:45:21.000000000 -0800
@@ -116,6 +116,9 @@
   /* try to open personal "cfilters"/"dfilters" file */
   ff_path = get_persconffile_path(ff_name, FALSE);
   if ((ff = eth_fopen(ff_path, "r")) == NULL) {
+    ff_path = get_datafile_path(ff_name);
+  }
+  if ((ff = eth_fopen(ff_path, "r")) == NULL) {
The get_datafile_path is used already in line 156, so this should already work the expected way ?!?

Regards, ULFL