Message ID | dc50c4f40f0a265897dfe202b978902656a30c1a.1672831998.git.nabijaczleweli@nabijaczleweli.xyz (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | [v2,1/2] options: getopts: ignore first --, per POSIX | expand |
diff --git a/src/exec.c b/src/exec.c index 87354d4..d61881d 100644 --- a/src/exec.c +++ b/src/exec.c @@ -760,11 +760,11 @@ unsetfunc(const char *name) int typecmd(int argc, char **argv) { - int i; int err = 0; - for (i = 1; i < argc; i++) { - err |= describe_command(out1, argv[i], NULL, 1); + nextopt(nullstr); + while (*argptr) { + err |= describe_command(out1, *argptr++, NULL, 1); } return err; }