From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1255 invoked from network); 13 Feb 2001 07:51:53 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Feb 2001 07:51:53 -0000 Received: (qmail 24473 invoked by alias); 13 Feb 2001 07:51:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13458 Received: (qmail 24462 invoked from network); 13 Feb 2001 07:51:41 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: Subject: More incompatibility :-) RE: PATCH: 3.1.9-dev-8: Re: Word splitting in zsh Date: Tue, 13 Feb 2001 10:51:32 +0300 Message-ID: <000801c09591$c7dd2790$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <1010210202412.ZM20301@candle.brasslantern.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > > OK, here's the patch; I won't commit this until I get some feedback on it. > This fixes one more incompatibility, so I am in favour of applying it. Zsh: bor@itsrm2% foo=$'foo\nbar' bor@itsrm2% print "$foo" foo bar bor@itsrm2% setopt shwordsplit bor@itsrm2% bar=${1-$foo} bor@itsrm2% print "$bar" foo bar sh: $ foo=`echo 'foo\nbar\c'` $ echo "$foo" foo bar $ bar=${1-$foo} $ echo "$bar" foo bar This just proves my point again - wordsplitting should be done once after all subst were done on current word. And only in context where wordsplitting is to be actually done. > + static int mult_spbreak, mult_shwsplit; They are static. Is there any chance, that two unrelated substitutions may run at the same time? E.g. inside nested command substitution? This forms its own context and both above must be reset. -andrej