Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: function copy



On Mon, 15 Jul 2019 at 22:01, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> +    if (OPT_ISSET(ops,'c')) {
> +       Shfunc newsh;
> +       if (!*argv || !argv[1] || argv[2]) {
> +           zwarnnam(name, "-c: requires two arguments");
> +           return 1;
> +       }

I'm probably wrong, as the tests should caught that up, but should the
"argv[2]" in the line:

> +       if (!*argv || !argv[1] || argv[2]) {

actually say "!argv[2]"?

Hmm.. There's probably a shift-like operation in bin_functions, which
makes the check argv[2] be actually for an third argument?

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author