top: some minor tweaks supporting long cmdline options
This darn patch began as 1 correction to an extraneous comma in the man document. Then, it grew to include an adjustment for a couple of additional man page things. After that, I figured I might as well tighten up logic dealing with those awful gaps in the getopt_long code. [ the error_exit mentioned in the associated comment ] [ will only be taken when '=' ends the argv vectors! ] Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -3829,8 +3829,10 @@ static void parse_args (int argc, char **argv) {
|
||||
cp = argv[optind++];
|
||||
if (cp) {
|
||||
if (*cp == '=') ++cp;
|
||||
if (*cp == '\0' && optind < argc) cp = argv[optind++];
|
||||
if (!cp || *cp == '\0') error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
|
||||
/* here, if we're actually accessing argv[argc], we'll rely on
|
||||
the required NULL delimiter which yields an error_exit next */
|
||||
if (*cp == '\0') cp = argv[optind++];
|
||||
if (!cp) error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
|
||||
}
|
||||
#endif
|
||||
switch (ch) {
|
||||
|
Reference in New Issue
Block a user