2 * Routines to handle command-line options to set paths for directories
3 * containing personal files (configuration, saved captures)
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include <wsutil/filesystem.h>
21 #include "ui/persfilepath_opt.h"
24 * process command line option that affects the paths of the directories
25 * used for personal files (configuration, saved captures)
28 persfilepath_opt(int opt _U_
, const char *optstr
)
32 colonp
= strchr(optstr
, ':');
41 * Skip over any white space (there probably won't be any, but
42 * as we allow it in the preferences file, we might as well
45 while (g_ascii_isspace(*p
))
49 * Put the colon back, so if our caller uses, in an
50 * error message, the string they passed us, the message
57 /* directory should be existing */
58 /* XXX - is this a requirement? */
59 if(test_for_directory(p
) != EISDIR
) {
61 * Put the colon back, so if our caller uses, in an
62 * error message, the string they passed us, the message
69 if (strcmp(optstr
,"persconf") == 0) {
70 set_persconffile_dir(p
);
71 } else if (strcmp(optstr
,"persdata") == 0) {
72 set_persdatafile_dir(p
);
74 /* XXX - might need to add the temp file path */
77 *colonp
= ':'; /* put the colon back */