Pass all arguments to options as --option=argument.
authorGuy Harris <guy@alum.mit.edu>
Thu, 26 Jul 2018 21:28:34 +0000 (14:28 -0700)
committerGuy Harris <guy@alum.mit.edu>
Thu, 26 Jul 2018 21:29:22 +0000 (21:29 +0000)
For options with optional arguments, the only syntax that's *guaranteed*
to be handled by getopt_long() is --option=argument, not --option
argument.  The BSD/macOS version of getopt_long() only supports the
former, not the latter.

Change-Id: Icfaec9eda49f5a947961251ebd377d7c1684c823
Reviewed-on: https://code.wireshark.org/review/28865
Reviewed-by: Guy Harris <guy@alum.mit.edu>
extcap.c

index 1744655685cc53fcab51df8600129685484c7b09..4a61ad536bf53796bb478cc8f2b239908e87fe9d 100644 (file)
--- a/extcap.c
+++ b/extcap.c
@@ -1355,8 +1355,11 @@ GPtrArray *extcap_prepare_arguments(interface_options *interface_opts)
                     else
                     {
                         if (stored && strlen(stored) > 0) {
-                            add_arg(arg_iter->call);
-                            add_arg(stored);
+                            char *argstring;
+
+                            argstring = g_strdup_printf("%s=%s", arg_iter->call, stored);
+                            add_arg(argstring);
+                            g_free(argstring);
                         }
                     }