From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29545 invoked by alias); 4 Sep 2014 19:16:00 -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: 33110 Received: (qmail 27812 invoked from network); 4 Sep 2014 19:15: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: [86.6.157.246] X-Spam: 0 X-Authority: v=2.1 cv=faIjyigF c=1 sm=1 tr=0 a=BvYiZ/UW0Fmn8Wufq9dPrg==:117 a=BvYiZ/UW0Fmn8Wufq9dPrg==:17 a=NLZqzBF-AAAA:8 a=TJ-Q1YwZWWoA:10 a=hownTTm8pc0A:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=9Ln0Dia1NQQatkXqXKEA:9 a=CjuIK1q_8ugA:10 a=I6wTmPyJxzYA:10 a=_dQi-Dcv4p4A:10 Date: Thu, 4 Sep 2014 20:10:21 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: The ~ parameter expansion flag: bug or misunderstanding Message-ID: <20140904201021.02738021@pws-pc.ntlworld.com> In-Reply-To: <140903201824.ZM16856@torch.brasslantern.com> References: <20140903161418.3f79636b@pwslap01u.europe.root.pri> <140903201824.ZM16856@torch.brasslantern.com> 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 Wed, 03 Sep 2014 20:18:24 -0700 Bart Schaefer wrote: > What this doesn't say is that if STRING2 is the empty string, a space > is inserted instead: Apparently the same for STRING1. Looking at the code, this appears to be the following intentional but undocumented feature. diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index d01d804..b4aa9c7 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1155,6 +1155,10 @@ var(string1) and var(string2) are given, tt(string2) is inserted once directly to the left of each word, truncated if necessary, before var(string1) is used to produce any remaining padding. +If either of var(string1) or tt(string2) is present but empty, +i.e. there are two delimiters together at that point, the first +character of tt($IFS) is used instead. + If the tt(MULTIBYTE) option is in effect, the flag tt(m) may also be given, in which case widths will be used for the calculation of padding; otherwise individual multibyte characters are treated as occupying -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/