From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5758 invoked by alias); 10 Aug 2016 13:06:28 -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: 39013 Received: (qmail 7338 invoked from network); 10 Aug 2016 13:06:28 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.11):SA:0(-0.4/5.0):. Processed in 0.13734 secs); 10 Aug 2016 13:06:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) X-AuditID: cbfec7f4-f796c6d000001486-f3-57ab2471280f Date: Wed, 10 Aug 2016 13:56:13 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [bug] shwordsplit not working on $@ when $# > 1 Message-id: <20160810135613.6c4fa427@pwslap01u.europe.root.pri> In-reply-to: <160808182124.ZM9355@torch.brasslantern.com> References: <20160808111626.GA19766@chaz.gmail.com> <20160808192734.21923640@ntlworld.com> <160808182124.ZM9355@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xa7qFKqvDDVZ8U7Y42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGa/ffWcv+MZZMWmVZwPjVfYuRk4OCQETia57p5ghbDGJC/fW s3UxcnEICSxllOi6u5cJwpnBJHG8ZRmUc45RYsfF/1BlZxklHk+/xQLSzyKgKrFu+zVWEJtN wFBi6qbZjCC2iIC4xNm158FqhAVsJLrOzQOL8wrYSzxd+BfoDg4OTgFLiZ9TwM4QEuhmlFh1 vRTE5hfQl7j69xMTxHn2EjOvnIFqFZT4Mfke2EhmAS2JzduaWCFseYnNa95CzVGXuHF3N/sE RuFZSFpmIWmZhaRlASPzKkbR1NLkguKk9FxDveLE3OLSvHS95PzcTYyQYP6yg3HxMatDjAIc jEo8vBuYVoULsSaWFVfmHmKU4GBWEuFlVlgdLsSbklhZlVqUH19UmpNafIhRmoNFSZx37q73 IUIC6YklqdmpqQWpRTBZJg5OqQZGeW5NluM9Xsoslzvv/jVYM4H19Maly6V2Hu/YurH8Ju+5 Y+cffPX+f4Bz/QYnm3eFO1SYjpc+UXLrnbks+f9mjqfWCZzr06Qbql2mznxhv4nb1kLn2r2F edvF7kgJ9a/56Mrv8WtD5OtMzU/Mf1/xJzv8WuHPeDBabgf7vsl/ZG8wqVYbHZvuq8RSnJFo qMVcVJwIAJBGDX9iAgAA > Existing tests still pass, but then they always did, this needs a > new one. Holding off until we think of other edge cases. This tests the significant cases with $@. There's already quite a lot with splitting, joining, IFS and SH_WORD_SPLIT in that file, so I'm not sure how much more there is to do. Not quite sure what forced joining gets us apart from extra complexity but too late to worry now... pws diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 7cb297e..6767eb2 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -1920,3 +1920,38 @@ print $array 0:"-" works after "[" in same expression (Dash problem) >foo two three + + ( + setopt shwordsplit + IFS=: + set -- whim:wham:whom + print -l $@ + ) +0:Splitting of $@ on IFS: single element +>whim +>wham +>whom + + ( + setopt shwordsplit + IFS=: + set -- one:two bucklemy:shoe + print -l $@ + ) +0:Splitting of $@ on IFS: multiple elements +# No forced joining in this case +>one +>two +>bucklemy +>shoe + + ( + setopt shwordsplit + set -- one:two bucklemy:shoe + print -l ${(s.:.)@} + ) +0:Splitting of $@ on (s): multiple elements +# Forced joining in this case +>one +>two bucklemy +>shoe