ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Interesting problem with tshark - understood and solved

Date Prev · Date Next · Thread Prev · Thread Next
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 30 Jun 2006 16:42:50 -0700

On Jun 30, 2006, at 12:27 PM, Bryant Eastham wrote:

I now understand the problem, and have found the problem in the code.
I should have mentioned that I am running tshark from a build, not
an installed, directory. It appears that tshark.c is missing the call
"init_progfile_dir(argv[0]);". Without this call, the data directory
is never initialized and defaults on Windows to the C:/Program Files/...
directory.

On UN*X, it works without the call; the program file directory is used only to run dumpcap, which tshark currently doesn't do.

On Windows, it doesn't work without the call; the program file directory is also the data directory.

I've checked in a fix to make the call (unconditionally, as, in the future, it might be useful to have an option on UN*X to use the directory in which the executable exists as the data file directory, to make it possible to run Wireshark/tshark from the build directory and have it pick up data files and plugins without having to install them).