From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29438 invoked by alias); 25 Nov 2015 14:31:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20992 Received: (qmail 21319 invoked from network); 25 Nov 2015 14:31:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zEVCnRXjVq+4PoQFjasYk79zuMfDasVNd4CtOt40S9E=; b=wde2LiGwR2H3issj1U3aRJykg72uhaFKXMLjM/2o86g+LR8Pi5Kt1JErAcPMkFhLJz z5YIVFaBtcAbPF7c01VK5dMEzw9FZ2YCSH2jWRW7y9M6W3EUWz5Md6Po1UYk6Re2xcJK gGx3SalBdQ2ATEmsrAu+3TvWHstyXBQie+mhXtGz3o64ZtwIbgG0f6De8HlZsqUNFNWJ mysrU4YGjkMKQWtaWqJ3NVTiiW8TsXLxfcyuYom3ELG0H8spghUwNlXdKnNmPfEfR2b7 DrsW6l6ombVKUE0/4NiGZtOregoOuw9sqplL0jRp/3p48qYTqqeVsRhtZ/sCJbPLrSvj lX9g== MIME-Version: 1.0 X-Received: by 10.28.90.132 with SMTP id o126mr3273906wmb.1.1448441375373; Wed, 25 Nov 2015 00:49:35 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Nov 2015 15:49:35 +0700 Message-ID: Subject: Re: [Zsh bug] function define bug From: Cuong Manh Le To: =?UTF-8?B?TmfDtCBIdXk=?= Cc: Matthew Martin , Zsh Users Content-Type: multipart/alternative; boundary=001a11453cf4a840f205255989cb --001a11453cf4a840f205255989cb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Severus, Can you give a demo? You can turn off `mult=C3=AC_func_def` but you can always do multiple funct= ion definition with reserved word `function` Best. On Wed, Nov 25, 2015 at 11:20 AM, Ng=C3=B4 Huy wrot= e: > Dear Matthew > > 2015-11-25 11:06 GMT+07:00 Matthew Martin : > > > On Tue, Nov 24, 2015 at 9:46 PM, Ng=C3=B4 Huy w= rote: > > > 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 zs= h > > 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=C3=AC_f= unc_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 > --001a11453cf4a840f205255989cb--