From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3721 invoked by alias); 14 Sep 2016 09:56:21 -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: 21904 Received: (qmail 17045 invoked from network); 14 Sep 2016 09:56:21 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f171.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.171):SA:0(0.0/5.0):. Processed in 0.323204 secs); 14 Sep 2016 09:56:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/QlfER1WSUHd/Zjlc8MAi2UU9QgT+kamCdYjLLgSL0s=; b=CAzJJOYo1girfCS8i9W+nvUeV5rfiG6hTHimrFblMqxZOv7QySAQUSeUUAbA8dUcgx rinAfwuM4HPJiY4kZA43SFe57EK3qbtExOl0kbDL62CmrxdfUjMF75/RFAlFGFkX0jj5 oBEKwo8m2gz7QCp2UvslYl1IuN3O1Vfm1Qo0FM8KeK/iLJ2Wxsp+LIb6IWw3axvJOkvD bdnY7lhS0PriE9GEeBJSmbH4klbl6PRIgNqXvlI4kLqFCUDKoBeMsqyYlQXo1BK16JKt OhIEppijwF/mItRXh7ldRGuPck7MPPcX+Ucm8Tu3DUTlTupKTn/L1KuSRf/mFzNu9B2O g2jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/QlfER1WSUHd/Zjlc8MAi2UU9QgT+kamCdYjLLgSL0s=; b=a/pmiNG+Sn9Q4zidsBmAm1FinyOmutySe4umVowKEW+uKqVQaQnbvQKdMm29lm7Pe1 J/vhFfDpp7jcMpI9xzEQOqQ7r8/t+koY3cMAfW6IJh6sK7juvBIUqR2bnANoKRFbaZkM Vc8Y0VXI9SHOFjS2p4PWI+0/Jjlx+I6YHc3IxRBpDsxmEmiJJfbfk4eol0vRFhbePywc dRbt4PHRm8Qp4GhYuAKYs5rljbiqXKogDfzxSIsKc4/7JEx80pE6RiLP33OSfhdR8QwP A9z9TSe0+I5nZKY5n90frFRcwpBMXBF7m+oodS7DOqLBGPAePdjckLyzB9FTvHoeKLLp le6A== X-Gm-Message-State: AE9vXwO4b09AYgB/1ukyytuNa1NDZ9Y1UMSKkOdHkhO/Zmmcb8yAeQ42HZU3umkmBGOgFXFVfcZjP0up7CO7Kw== X-Received: by 10.55.127.1 with SMTP id a1mr1551395qkd.49.1473841154262; Wed, 14 Sep 2016 01:19:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1473840044.77968.725190513.460F8572@webmail.messagingengine.com> References: <1473840044.77968.725190513.460F8572@webmail.messagingengine.com> From: Mikael Magnusson Date: Wed, 14 Sep 2016 10:19:13 +0200 Message-ID: Subject: Re: Possible bug: Zsh function does not terminate when ${name:?word} fails To: Ronald Fischer Cc: Zsh Mailing-List Content-Type: text/plain; charset=UTF-8 On Wed, Sep 14, 2016 at 10:00 AM, Ronald Fischer wrote: > (See also for a complete discussion: > http://stackoverflow.com/questions/39463547/zsh-function-does-not-terminate-when-nameword-fails?noredirect=1#comment66276136_39463547) > > I have in my .zshrc the following function definition (simplified > example): > > function foo { > local p=${1:?parameter missing} > echo continue .... > } > > Running the function by just typing foo produces, as expected, the > message parameter missing, but it also outputs continue. I had expected > that the function terminates when the :? check fails, but it continues > to run. > > I tested this with zsh 5.1.1, but I was informed that this behaviour > also can be reproduced with zsh 5.2 This seems to be a side effect of the reserved word handling, if you do disable -r local then it behaves as expected. Being in a function or not makes no difference, the same thing happens if you do local p=${foo:?hello}; echo continue on the command line. -- Mikael Magnusson