From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15162 invoked by alias); 30 Sep 2012 16:00:50 -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: 17299 Received: (qmail 3848 invoked from network); 30 Sep 2012 16:00:48 -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: <120930090023.ZM26333@torch.brasslantern.com> Date: Sun, 30 Sep 2012 09:00:23 -0700 In-reply-to: <20120930073552.GC7385@localhost.localdomain> Comments: In reply to Han Pingtian "question of (C) and (s::)" (Sep 30, 3:35pm) References: <20120930073552.GC7385@localhost.localdomain> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: question of (C) and (s::) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 30, 3:35pm, Han Pingtian wrote: } } % x=foosbar;print ${(Cs:s:)x} } Foo Bar } } But in rules of parameter expansion flags, "case mofification" is the } 11th, "forced splitting" is the 16th, so I think we should get "Foo bar" } as the result here. Right? Or I'm missing something here? Hmm, I think "The Rules" have one thing out of place. (f) and (s) and even the shell word splitting (both SH_WORD_SPLIT and the '=' flag) are applied immediately after "forced joining". The only thing that's delayed until just before "uniqueness" is the (z) flag. Either this changed at some point (entirely possible as several tweaks have been made over the years to make SH_WORD_SPLIT behave more like the original /bin/sh) or the code in subst.c was misread when the rules were composed (the comment in subst.c explaining that the (z) section doesn't have anything to do with (s) post-dates the rules). So really 16 and 17 should be combined as 11 except that mention of (z) should be removed from the new 11; the old 11 through 15 should be renumbered 12 through 16; and 17 should be the (z) flag by itself.