aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-19 23:54:33 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-20 07:00:07 +0000
commit88b7a48bf59a047fbe172442f6ec0b7c9a1900a8 (patch)
treef4eec5022ef0bde6fa9ce6dd6da3c077522c4ab2
parent77950826f1755472ad9717a41e45b86b23663957 (diff)
Pull the options structure initialization into commandline_other_options().
Change-Id: I931cde27a81566dfa0ce6e5c9307bfc1a4d5fe54 Reviewed-on: https://code.wireshark.org/review/16033 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--ui/commandline.c15
-rw-r--r--ui/gtk/main.c15
-rw-r--r--wireshark-qt.cpp15
3 files changed, 15 insertions, 30 deletions
diff --git a/ui/commandline.c b/ui/commandline.c
index 8e55d8b79a..9381ed1a6b 100644
--- a/ui/commandline.c
+++ b/ui/commandline.c
@@ -378,6 +378,21 @@ void commandline_other_options(int argc, char *argv[], commandline_param_info_t*
opterr = 1;
}
+ /* Initialize with default values */
+ param_info->jump_backwards = SD_FORWARD;
+ param_info->go_to_packet = 0;
+ param_info->jfilter = NULL;
+ param_info->cf_name = NULL;
+ param_info->rfilter = NULL;
+ param_info->dfilter = NULL;
+#ifdef HAVE_LIBPCAP
+ param_info->start_capture = FALSE;
+ param_info->list_link_layer_types = FALSE;
+#endif
+ param_info->disable_protocol_slist = NULL;
+ param_info->enable_heur_slist = NULL;
+ param_info->disable_heur_slist = NULL;
+
while ((opt = getopt_long(argc, argv, optstring, long_options, NULL)) != -1) {
switch (opt) {
/*** capture option specific ***/
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 8524dd7c98..9c61cae68a 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -2360,21 +2360,6 @@ main(int argc, char *argv[])
fill_in_local_interfaces();
#endif*/
- /* Initialize commandline_info with default values */
- commandline_info.jump_backwards = SD_FORWARD;
- commandline_info.go_to_packet = 0;
- commandline_info.jfilter = NULL;
- commandline_info.cf_name = NULL;
- commandline_info.rfilter = NULL;
- commandline_info.dfilter = NULL;
-#ifdef HAVE_LIBPCAP
- commandline_info.start_capture = FALSE;
- commandline_info.list_link_layer_types = FALSE;
-#endif
- commandline_info.disable_protocol_slist = NULL;
- commandline_info.enable_heur_slist = NULL;
- commandline_info.disable_heur_slist = NULL;
-
/* Now get our args */
commandline_other_options(argc, argv, &commandline_info, TRUE);
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp
index 9bc9ac826e..6aff5979c8 100644
--- a/wireshark-qt.cpp
+++ b/wireshark-qt.cpp
@@ -595,21 +595,6 @@ int main(int argc, char *argv[])
commandline_info.prefs_p = ws_app.readConfigurationFiles(&gdp_path, &dp_path, false);
- /* Initialize commandline_info with default values */
- commandline_info.jump_backwards = SD_FORWARD;
- commandline_info.go_to_packet = 0;
- commandline_info.jfilter = NULL;
- commandline_info.cf_name = NULL;
- commandline_info.rfilter = NULL;
- commandline_info.dfilter = NULL;
-#ifdef HAVE_LIBPCAP
- commandline_info.start_capture = FALSE;
- commandline_info.list_link_layer_types = FALSE;
-#endif
- commandline_info.disable_protocol_slist = NULL;
- commandline_info.enable_heur_slist = NULL;
- commandline_info.disable_heur_slist = NULL;
-
/* Now get our args */
commandline_other_options(argc, argv, &commandline_info, TRUE);