diff --git a/compat/getopt.c b/compat/getopt.c index 3a532372..38c317cc 100644 --- a/compat/getopt.c +++ b/compat/getopt.c @@ -67,6 +67,8 @@ BSDgetopt(int nargc, char *const *nargv, const char *ostr) return (-1); } if (place[1] && *++place == '-') { /* found "--" */ + if (place[1]) + return (BADCH); ++BSDoptind; place = EMSG; return (-1);