From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11082 invoked by alias); 5 Nov 2016 06:13:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39838 Received: (qmail 27188 invoked from network); 5 Nov 2016 06:13:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua0-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.217.171):SA:0(0.0/5.0):. Processed in 0.588584 secs); 05 Nov 2016 06:13:54 -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=SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.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.217.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=BusLOyyuc224/XbrvNqb5yIYCBBzndmOzGVji4bvyx4=; b=zSLpKr4+ubNgx+faf8aQXOdf1+a1jUjw00PICh7mkaoW8rc1tq6eHqRqzihxMRXGBR IhjcgvSSbHkg6iKsrHiMAxsS9vxRdWFMwR6A2ps5N3IxXmUpX3AHwSlkdqVyBjitHrIk Tt6Wg1tL2EW4yKFF+w+xhEb1L8YGB8JpCBw3J9wV/YPaFeFM5FBF/TUTsgKaU66k7Mr/ qokCpckL60y3vgKEKr4YV5p4AO5/r5sjliKFb9gIgmM63F4H5gpbsofQl9xYc37MFRq1 CqSxV7LQwT1rLJtiK/cdLwxo2nWMuQ9qpWhn+hTi59XfX7VR2GQl/u7PiwpDvwslgf/V DJdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=BusLOyyuc224/XbrvNqb5yIYCBBzndmOzGVji4bvyx4=; b=d9L5xVzr2b4Fevi1fc/l8CK0GbQLd8O8BYsDya/mvjHj0bkW0HTtmTyybopu33/GpU 2Fl0tgyhIF7i9/WMj65I7kUx9mxJm9ZTXqP3uN8k4Mzq68W9WrIp5ELsgwRwXNlhtM4O UVJJCZByAFxQo1I7UsxDRARgpFfP0SLQnJAajiVt53RbqEpdbQlSDAaLDODZVC96vlAY jijF1DsqDdh8eigetnV3RNZViaoLZCpsP9Vcm2wwL9bpTOP8kYewN2Zr1SEo4bfrHdT4 BzRTKXSdLig6efJJ3x84ZOpw/rlXnvX461CIUqy3Zorqft+KPubOLthCI/jQXP2jXFs+ JAQA== X-Gm-Message-State: ABUngveG2D011Q4t2cjg4qvpE2dS/DbNZP237tDTNsCbQJBZHxbizQrOwiZR+ZyWyWxaSA== X-Received: by 10.159.38.41 with SMTP id 38mr11948215uag.26.1478318587067; Fri, 04 Nov 2016 21:03:07 -0700 (PDT) From: Bart Schaefer Message-Id: <161104210337.ZM18190@torch.brasslantern.com> Date: Fri, 4 Nov 2016 21:03:37 -0700 In-Reply-To: <43147.1478277455@hydra.kiddle.eu> Comments: In reply to Oliver Kiddle "Re: PATCH: print -v with an array" (Nov 4, 5:37pm) References: <53992.1474303843@hydra.kiddle.eu> <160919133047.ZM28795@torch.brasslantern.com> <76611.1474487469@hydra.kiddle.eu> <160921142420.ZM3676@torch.brasslantern.com> <43147.1478277455@hydra.kiddle.eu> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh workers Subject: Re: PATCH: print -v with an array MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 4, 5:37pm, Oliver Kiddle wrote: } Subject: Re: PATCH: print -v with an array } } On 21 Sep, Bart wrote: } > Yes, I'm wondering if print -S -f ... should just be an error. } } Combining print -S with multiple arguments with a zsh debug build is printing: } exec.c:3837: BUG: q = 3 != queue_in = 4 Thanks for spotting that. Patch below. Doesn't answer the question of whether -S -f should be an error. At the moment -S and -C and -c are all ignored if -f is with them. There is code commented out to make an error of this. } The most notable thing about this patch is what it does not do. I've } not moved the array behaviour to a -A option. That's not something } I'm especially bothered about and if someone is keen to change it } then I don't especially care. It has occurred to me that zsh doesn't really need print -v, except for compatibility. Other bourne-ish shells fork the right side of pipes, so piping to read -A won't capture anything in the parent, but zsh forks to the left. I suppose print -v does avoid that fork. diff --git a/Src/builtin.c b/Src/builtin.c index b7b7bdf..6c9d058 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4552,6 +4552,7 @@ bin_print(char *name, char **args, Options ops, int func) short *words; if (nwords > 1) { zwarnnam(name, "option -S takes a single argument"); + unqueue_signals(); return 1; } words = NULL;