[PATCH 3/3] ash: exec: -a option for setting zeroth arg

Denys Vlasenko vda.linux at googlemail.com
Wed Apr 12 19:35:08 UTC 2017


On Tue, Apr 11, 2017 at 11:58 PM, Kaarle Ritvanen
<kaarle.ritvanen at datakunkku.fi> wrote:
> -execcmd(int argc UNUSED_PARAM, char **argv)
> +execcmd(int argc, char **argv)
>  {
> -       if (argv[1]) {
> +       int opt;
> +       char *argv0 = NULL;
> +       char *cmdname = NULL;
> +
> +       GETOPT_RESET
> +       while ((opt = getopt(argc, argv, "a:")) != -1)

(1) The rest of ash does not use getopt().

(2) Did you test this with, say, "exec stty -a" command?

I committed a change which implements "exec -a"
in a slightly different way. Please try current git.


More information about the busybox mailing list