Message ID | d7d04bbcf75c97c52726bf65e9ed4d9310ebdd51.1670966008.git.nabijaczleweli@nabijaczleweli.xyz (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Herbert Xu |
Headers | show |
Series | [1/2] exec: type: ignore first --, per POSIX | expand |
diff --git a/src/options.c b/src/options.c index a46c23b..337a8ee 100644 --- a/src/options.c +++ b/src/options.c @@ -409,6 +409,9 @@ getoptscmd(int argc, char **argv) { char **optbase; + nextopt(nullstr); + argc -= argptr - argv - 1; + argv = argptr - 1; if (argc < 3) sh_error("Usage: getopts optstring var [arg]"); else if (argc == 3) {