wireshark/wsutil
Guy Harris 19f7e572a4 Work around macOS running applications in /.
If an application is launched from the Finder, it appears to get / as
its current directory.  This causes Wireshark open/save dialogs to open
up / if the user hasn't already opened a file in another directory, so
that there's no "last open directory" in the recent file.

Have get_persdatafile_dir(), on UN*X, cache the personal data directory
just as it does on Windows and, if nothing's been cached, have it fetch
the current directory and, if that succeeds *and* it's not the root
directory, use that.  Otherwise, use the user's home directory.

Fixes #9862.

In addition, separate the notion of "last open directory" and "open
dialog initial directory", where the latter is the last open directory
*if* a file has been opened in this session or the recent file has the
last open directory from a previous session, otherwise it's the user's
personal data directory.

Use the latter notion in file open/save dialogs; use the former notion
when reading from and writing to the recent file.

This means we don't need to set the "last open directory" at startup
time.  That way, running Wireshark without opening a file won't cause
the "last open directory" to be set, so that if a user runs it from a
directory, the "open dialog initial directory" won't be the last
directory from which Wireshark was run.
2023-11-12 06:53:36 +00:00
..
wmem wmem_list: increment count for insert_sorted 2023-10-11 06:39:44 +00:00
.editorconfig Remove non-existent EditorConfig entry 2023-09-05 02:10:44 +01:00
802_11-utils.c radiotap: Improve indication of 6 GHz band channels 2023-10-31 02:37:14 +00:00
802_11-utils.h radiotap: Improve indication of 6 GHz band channels 2023-10-31 02:37:14 +00:00
CMakeLists.txt wsutil: Rename inet_netw.[ch] 2023-10-31 13:41:31 +00:00
adler32.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
adler32.h wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
base32.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
base32.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
bits_count_ones.h Tools: Add constant conversions to convert-glib-types 2023-09-29 05:58:06 +00:00
bits_ctz.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
bitswap.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
bitswap.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
buffer.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
buffer.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
cfutils.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
cfutils.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
clopts_common.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
clopts_common.h tshark: Support --read-file and filter long opts 2023-10-14 14:02:04 +00:00
cmdarg_err.c Move ui/cmdarg_err.[ch] to wsutil 2023-02-10 20:59:22 +00:00
cmdarg_err.h Move ui/cmdarg_err.[ch] to wsutil 2023-02-10 20:59:22 +00:00
codecs.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
codecs.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
color.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
console_win32.c Convert Windows utility code to C99 types 2023-09-15 13:11:20 -07:00
console_win32.h Convert Windows utility code to C99 types 2023-09-15 13:11:20 -07:00
cpu_info.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
cpu_info.h Make wsutil headers include what they use and build standalone 2023-06-24 13:22:02 +00:00
crash_info.c Add missing header, fix macOS build 2021-12-19 19:09:05 +00:00
crash_info.h Add missing header, fix macOS build 2021-12-19 19:09:05 +00:00
crc5.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc5.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc6.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc6.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc7.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc7.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc8.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc8.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc10.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc10.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc11.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc11.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc16-plain.c Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc16-plain.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc16.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
crc16.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
crc32.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
crc32.h Convert wsutil/crc*.[ch] to C99 types 2023-06-29 00:34:53 +00:00
curve25519.c Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
curve25519.h Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
dot11decrypt_wep.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
eax.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
eax.h wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
epochs.h Tools: Add constant conversions to convert-glib-types 2023-09-29 05:58:06 +00:00
exported_pdu_tlvs.h Exported PDU: Add new tag EXP_PDU_TAG_USER_DATA_PDU 2023-10-30 21:06:14 +00:00
feature_list.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
feature_list.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
file_util.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
file_util.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
filesystem.c Work around macOS running applications in /. 2023-11-12 06:53:36 +00:00
filesystem.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
filter_files.c dfilter: Replace macro UAT config file and update GUI 2023-11-08 11:45:54 +00:00
filter_files.h dfilter: Replace macro UAT config file and update GUI 2023-11-08 11:45:54 +00:00
g711.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
g711.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
glib-compat.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
inet_addr.c Fix build on case-sensitive filesystems 2023-05-24 02:49:28 +01:00
inet_addr.h wsutil: Consolidate IP address code 2023-10-31 10:14:09 +00:00
inet_cidr.c wsutil: Rename inet_netw.[ch] 2023-10-31 13:41:31 +00:00
inet_cidr.h wsutil: Rename inet_netw.[ch] 2023-10-31 13:41:31 +00:00
interface.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
interface.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
introspection.c wiretap: Add enum generation 2022-10-07 10:28:47 +01:00
introspection.h wiretap: Add enum generation 2022-10-07 10:28:47 +01:00
jsmn.c wsutil: split libjsmn. 2016-09-30 20:12:00 +00:00
jsmn.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
json_dumper.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
json_dumper.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
mpeg-audio.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
mpeg-audio.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
nstime.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
nstime.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
os_version_info.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
os_version_info.h Make wsutil headers include what they use and build standalone 2023-06-24 13:22:02 +00:00
path_config.h.in Add support for configuration path relocation on Unix 2023-01-26 18:43:20 +00:00
pint.h wsutil: Clean up some includes 2023-09-25 01:20:37 +00:00
please_report_bug.c Update our issue tracker URL in some places. 2020-09-16 01:29:07 +00:00
please_report_bug.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
plugins.c plugins: Make flags unsigned 2023-10-30 09:37:29 +00:00
plugins.h plugins: Make flags unsigned 2023-10-30 09:37:29 +00:00
pow2.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
privileges.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
privileges.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
processes.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
regex.c Find: Matching multiple occurrences in Packet Bytes 2023-10-27 05:56:29 +00:00
regex.h Find: Matching multiple occurrences in Packet Bytes 2023-10-27 05:56:29 +00:00
report_message.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
report_message.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
rsa.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
rsa.h wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
safe-math.h dfilter: Use safe-math.h with time ftypes 2023-06-27 18:31:28 +00:00
sign_ext.h Tools: Add constant conversions to convert-glib-types 2023-09-29 05:58:06 +00:00
sober128.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
sober128.h Add files with WS_DLL_PUBLIC to Doxygen part2 2021-11-30 06:47:35 +00:00
socket.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
socket.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
str_util.c tshark: Escape delimiter separated value in compliant ways 2023-11-09 09:17:03 +00:00
str_util.h tshark: Escape delimiter separated value in compliant ways 2023-11-09 09:17:03 +00:00
strnatcmp.c Make wsutil headers include what they use and build standalone 2023-06-24 13:22:02 +00:00
strnatcmp.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
strtoi.c wsutil: Clean up some includes 2023-09-25 01:20:37 +00:00
strtoi.h wsutil: Convert string modules to C99 types 2023-09-22 17:27:35 -07:00
tempfile.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
tempfile.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
test_wsutil.c tshark: Escape delimiter separated value in compliant ways 2023-11-09 09:17:03 +00:00
time_util.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
time_util.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
to_str.c wsutil/to_str: Deprecate ip_to_str() for endian-explicit versions 2023-10-29 15:17:31 +00:00
to_str.h wsutil/to_str: Deprecate ip_to_str() for endian-explicit versions 2023-10-29 15:17:31 +00:00
type_util.c Tools: Add constant conversions to convert-glib-types 2023-09-29 05:58:06 +00:00
type_util.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
unicode-utils.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
unicode-utils.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
utf8_entities.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
version_info.c CMake: Rework assertions and add dependency on NDEBUG 2023-09-21 09:35:11 +00:00
version_info.h Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
win32-utils.c Convert Windows utility code to C99 types 2023-09-15 13:11:20 -07:00
win32-utils.h Convert Windows utility code to C99 types 2023-09-15 13:11:20 -07:00
ws_assert.h CMake: Rework assertions and add dependency on NDEBUG 2023-09-21 09:35:11 +00:00
ws_cpuid.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_getopt.c Make wsutil headers include what they use and build standalone 2023-06-24 13:22:02 +00:00
ws_getopt.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ws_mempbrk.c wsutil: Add a reverse mempbrk function 2023-10-27 05:56:29 +00:00
ws_mempbrk.h wsutil: Add a reverse mempbrk function 2023-10-27 05:56:29 +00:00
ws_mempbrk_int.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_mempbrk_sse42.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_pipe.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_pipe.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_roundup.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
ws_strptime.c strptime(wsutil): fix Dead increment 2023-09-21 23:33:17 +00:00
ws_strptime.h dfilter: Extend support for timezones in filter expressions 2023-09-08 14:10:11 +01:00
wsgcrypt.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
wsgcrypt.h wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
wsjson.c Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
wsjson.h Convert wsutil to C99 types 2023-09-24 19:05:10 +00:00
wslog.c wslog: Set a GLib default handler 2023-09-30 14:11:10 +00:00
wslog.h wslog: Add WS_NOT_IMPLEMENTED() macro 2023-10-18 09:40:56 +00:00
xtea.c wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00
xtea.h wsutil: Convert our cryptograpy code to C99 types 2023-09-15 19:51:45 +00:00