From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4120 invoked by alias); 29 Aug 2011 17:06:37 -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: 29744 Received: (qmail 2944 invoked from network); 29 Aug 2011 17:06:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: neutral (ns1.primenet.com.au: 74.125.82.43 is neither permitted nor denied by SPF record at ntlworld.com) X-ProxyUser-IP: 81.97.71.129 Date: Mon, 29 Aug 2011 18:06:24 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Is "read -AE" buggy? Message-ID: <20110829180624.66c89634@pws-pc.ntlworld.com> In-Reply-To: <110829082605.ZM2790@torch.brasslantern.com> References: <110823001827.ZM19096@torch.brasslantern.com> <20110828175014.7750a85e@pws-pc.ntlworld.com> <110829082605.ZM2790@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I think I should be a bit more careful in the non '-A' case. Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.253 diff -p -u -r1.253 builtin.c --- Src/builtin.c 28 Aug 2011 17:06:27 -0000 1.253 +++ Src/builtin.c 29 Aug 2011 17:05:24 -0000 @@ -5549,7 +5549,14 @@ bin_read(char *name, char **args, Option *bptr = '\0'; #endif /* dispose of word appropriately */ - if (OPT_ISSET(ops,'e')) { + if (OPT_ISSET(ops,'e') || + /* + * When we're doing an array assignment, we'll + * handle echoing at that point. In all other + * cases (including -A with no assignment) + * we'll do it here. + */ + (OPT_ISSET(ops,'E') && !OPT_ISSET(ops,'A'))) { zputs(buf, stdout); putchar('\n'); } -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/