From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17969 invoked by alias); 28 Apr 2012 02:51:05 -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: 17027 Received: (qmail 5623 invoked from network); 28 Apr 2012 02:51:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120427195048.ZM10479@torch.brasslantern.com> Date: Fri, 27 Apr 2012 19:50:48 -0700 In-reply-to: <20120427213837.1b861851@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: ${(s::)VAR} vs "${(s::)VAR}"" (Apr 27, 9:38pm) References: <20120427213837.1b861851@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: ${(s::)VAR} vs "${(s::)VAR}" MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Apr 27, 9:38pm, Peter Stephenson wrote: } } This comes from the function wordcount() in utils.c, which is called in } a couple of functions used for splitting words, none of which has any } comments apart from a few speculations from me dating from 2003. The } function takes a mysterious argument mul which presumably has got } something to do with doing something multiple times. "mul" takes values -1, 0, 1. The only time it's less than zero is when called from spacesplit() with allownull == 0. So it must have to do with handling multiple consecutive appearances of the separator. } for (; (c = findsep(&s, sep, 0)) >= 0; s += sl) } - if ((c && *(s + sl)) || mul) } + if ((c || mul) && *(s + sl)) } r++; Does it matter that the changed line dereferences s+sl in cases where the original line does not?