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



>
> 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