Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/stdlib/getopt_long.c
Show First 20 Lines • Show All 475 Lines • ▼ Show 20 Lines | #endif | ||||
if (long_options != NULL && place != nargv[optind] && | if (long_options != NULL && place != nargv[optind] && | ||||
(*place == '-' || (flags & FLAG_LONGONLY))) { | (*place == '-' || (flags & FLAG_LONGONLY))) { | ||||
short_too = 0; | short_too = 0; | ||||
#ifdef GNU_COMPATIBLE | #ifdef GNU_COMPATIBLE | ||||
dash_prefix = D_PREFIX; | dash_prefix = D_PREFIX; | ||||
#endif | #endif | ||||
if (*place == '-') { | if (*place == '-') { | ||||
place++; /* --foo long option */ | place++; /* --foo long option */ | ||||
if (*place == '\0') | |||||
return (BADARG); /* malformed option */ | |||||
#ifdef GNU_COMPATIBLE | #ifdef GNU_COMPATIBLE | ||||
dash_prefix = DD_PREFIX; | dash_prefix = DD_PREFIX; | ||||
#endif | #endif | ||||
} else if (*place != ':' && strchr(options, *place) != NULL) | } else if (*place != ':' && strchr(options, *place) != NULL) | ||||
short_too = 1; /* could be short option too */ | short_too = 1; /* could be short option too */ | ||||
optchar = parse_long_options(nargv, options, long_options, | optchar = parse_long_options(nargv, options, long_options, | ||||
idx, short_too, flags); | idx, short_too, flags); | ||||
▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines |