X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/39f09d68ce7ebe9e229c9bf5209bfc30a8f51064..c793dbef549f0c7bad09daa33e0b4bf5d1f62f04:/missing/getopt_long.c diff --git a/missing/getopt_long.c b/missing/getopt_long.c index 5018400e..e9b1ef57 100644 --- a/missing/getopt_long.c +++ b/missing/getopt_long.c @@ -70,7 +70,7 @@ /* return values */ #define BADCH (int)'?' #define BADARG ((*options == ':') ? (int)':' : (int)'?') -#define INORDER (int)1 +#define INORDER (int)1 #define EMSG "" @@ -419,8 +419,7 @@ start: permute_args(nonopt_start, nonopt_end, optind, nargv); optind -= nonopt_end - nonopt_start; - } - else if (nonopt_start != -1) { + } else if (nonopt_start != -1) { /* * If we skipped non-options, set optind * to the first of them. @@ -565,11 +564,11 @@ start: ++optind; } else { /* takes (optional) argument */ optarg = NULL; + if (*place) { /* no white space */ DIAG_OFF_CAST_QUAL - if (*place) /* no white space */ optarg = (char *)place; DIAG_ON_CAST_QUAL - else if (oli[1] != ':') { /* arg not optional */ + } else if (oli[1] != ':') { /* arg not optional */ if (++optind >= nargc) { /* no arg */ place = EMSG; if (PRINT_ERROR)