From: "Ngô Huy" <huynhok.uit@vnoss.org>
To: Matthew Martin <phy1729@gmail.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: [Zsh bug] function define bug
Date: Wed, 25 Nov 2015 11:20:21 +0700 [thread overview]
Message-ID: <CAPO9Zdp4eHtM3n0GrP0TE2b9-u=6eWXYzrZg6w4BtbTL7644zA@mail.gmail.com> (raw)
In-Reply-To: <CAGnh9tB8oEua8npLmkhbPPBvMq1C3wfusnTo0MzLx0RjAiGaHw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]
Dear Matthew
2015-11-25 11:06 GMT+07:00 Matthew Martin <phy1729@gmail.com>:
> On Tue, Nov 24, 2015 at 9:46 PM, Ngô Huy <huynhok.uit@vnoss.org> wrote:
> > Dear folks,
> >
> > I found the problem in zsh define function. Demo
> >
> > ls test() { echo "Bug !!!"} && ls && test
> >
> > it will print
> >
> > Bug !!!
> > Bug !!!
>
>
> That's expected behaviour. Since MULTI_FUNC_DEF is set by default in zsh
> mode, both ls and test are being defined as functions with the body
> echo "Bug !!!".
>
> % func1 func2 () { echo This is "$0"; }
> % func1; func2
> This is func1
> This is func2
> % which func{1,2}
> func1 () {
> echo This is "$0"
> }
> func2 () {
> echo This is "$0"
> }
> % unsetopt MULTI_FUNC_DEF
> % func1 func2 () { echo This is "$0"; }
> zsh: parse error near `()'
>
I know this behavior likes advanced programming language but multì_func_def
should be turned off by default, it leads to risky problem when someone
searchs as grep, ls malicious strings without quote
Kind regards,
Severus
next prev parent reply other threads:[~2015-11-25 4:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 3:46 Ngô Huy
2015-11-25 4:06 ` Matthew Martin
2015-11-25 4:20 ` Ngô Huy [this message]
2015-11-25 8:49 ` Cuong Manh Le
2015-11-25 9:03 ` Ngô Huy
2015-11-25 9:04 ` Ngô Huy
2015-11-25 9:16 ` Christoph (Stucki) von Stuckrad
2015-11-25 9:20 ` Cuong Manh Le
2015-11-25 9:39 ` Ngô Huy
2015-11-25 9:58 ` Cuong Manh Le
2015-11-25 10:00 ` Peter Stephenson
2015-11-25 10:13 ` Ngô Huy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPO9Zdp4eHtM3n0GrP0TE2b9-u=6eWXYzrZg6w4BtbTL7644zA@mail.gmail.com' \
--to=huynhok.uit@vnoss.org \
--cc=phy1729@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).