From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17197 invoked by alias); 28 Sep 2014 17:45:07 -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: 33263 Received: (qmail 8279 invoked from network); 28 Sep 2014 17:44:55 -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 X-Originating-IP: [80.3.229.105] X-Spam: 0 X-Authority: v=2.1 cv=dY0O3Bne c=1 sm=1 tr=0 a=uz1KDxDNIq33yePw376BBA==:117 a=uz1KDxDNIq33yePw376BBA==:17 a=NLZqzBF-AAAA:8 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=lvzGJR2ni2YBVrpgcx8A:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=_dQi-Dcv4p4A:10 Date: Sun, 28 Sep 2014 18:39:19 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [patch] Fix VCS_INFO_reposub's whitespace handling Message-ID: <20140928183919.76bbfcbb@pws-pc.ntlworld.com> In-Reply-To: <20140928171033.GA11234@cheyenne> References: <20140928171033.GA11234@cheyenne> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 28 Sep 2014 19:10:33 +0200 Marco Hinz wrote: > Could someone point me to the appropriate parameter expansion rule? In ${$(pwd -P)#$base/} you're hitting the special rule applied to the command substitution rather than the parameter substitution. Zsh is actually less likely (by default) to split substitutions than other shells, but for $(...) it works the same way other shells do. You wouldn't hit this just with parameter substitution unless you had the option SH_WORD_SPLIT set. See the section COMMAND SUBSTITUTION in the zshexpn manual page. The second sentence is the exact rule. The only effect parameter substitution has on the result is the explicit one, i.e. removing $base/ from the head of the nested result. If you want the full hairy list of parameter rules (hint: you don't) search for "brain damage" in zshexpn. For nested operations involving command substitions, the description is a couple of paragraphs above "Parameter Expansion Flags". The following paragraph, indicating you can double-quote just the nested command substitution, is also relevant (your patch looks fine as it is since we're dealing throughout with one word). -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/