Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
More incompatibility :-) RE: PATCH: 3.1.9-dev-8: Re: Word splitting in zsh
- X-seq: zsh-workers 13458
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: <zsh-workers@xxxxxxxxxx>
- Subject: More incompatibility :-) RE: PATCH: 3.1.9-dev-8: Re: Word splitting in zsh
- Date: Tue, 13 Feb 2001 10:51:32 +0300
- Importance: Normal
- In-reply-to: <1010210202412.ZM20301@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
>
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author