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

Re: PATCH: function copy



On Mon, 2019-07-15 at 22:23 +0200, Sebastian Gniazdowski wrote:
> 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]"?

It it's an error if argument zero is empty, or argument one is empty, or
argument two is non-empty.

pws



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