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 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 #include <wsutil/filesystem.h>
34 #include "ui/persfilepath_opt.h"
37 * process command line option that affects the paths of the directories
38 * used for personal files (configuration, saved captures)
41 persfilepath_opt(int opt _U_, const char *optstr)
45 colonp = strchr(optstr, ':');
54 * Skip over any white space (there probably won't be any, but
55 * as we allow it in the preferences file, we might as well
58 while (isspace((guchar)*p))
62 * Put the colon back, so if our caller uses, in an
63 * error message, the string they passed us, the message
70 /* directory should be existing */
71 /* XXX - is this a requirement? */
72 if(test_for_directory(p) != EISDIR) {
74 * Put the colon back, so if our caller uses, in an
75 * error message, the string they passed us, the message
82 if (strcmp(optstr,"persconf") == 0) {
83 set_persconffile_dir(p);
84 } else if (strcmp(optstr,"persdata") == 0) {
85 set_persdatafile_dir(p);
87 /* XXX - might need to add the temp file path */
90 *colonp = ':'; /* put the colon back */
95 * Editor modelines - http://www.wireshark.org/tools/modelines.html
100 * indent-tabs-mode: nil
103 * vi: set shiftwidth=4 tabstop=8 expandtab:
104 * :indentSize=4:tabSize=8:noTabs=true: