Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Word splitting with zsh fix



Hi Raúl,

I would like to know if option SH_WORD_SPLIT is set problem is solved too ?

Test case:
===============================
#!/bin/zsh

VAR="v1 v2"

for V in ${VAR}; do
 echo V1=$V
done

setopt SH_WORD_SPLIT
for V in ${VAR}; do
 echo V2=$V
done
===============================
When SH_WORD_SPLIT is set zsh work as bash, ksh, ash etc.


DervishD wrote:
    Hi all :)

    I've spotted a problem with libtool that has to do with the word
splitting that Zsh does in the expression '${1+"$@"}' (which, in
turn, is a workaround to fix the "$@" expansion problem when the
variable is empty in old shells). GNU autoconf has already corrected
this problem, and I'm using a similar fix for libtool. The patch is
gzipped and attached to this message.

    Looking at the SUS (POSIX) standard, I'm not sure if field
splitting should be performed in the above expression or not, so I
don't know if the correct behaviour is what Bash does or what Zsh
does. Anyway, I'm not here looking for a culprit but for a solution.
I will be glad to discuss the issue, anyway, just for curiosity's
sake ;)

    I've tested the patch against "littlecms" sources, because that's
the package where the problem was spotted by David Gómez Espinosa
<david@xxxxxxxxxxxx>. The patch was suggested by Andrey Borzenkov
<arvidjaar@xxxxxxxxxx>.

    Thanks in advance and happy hacking :)

    Raúl Núñez de Arenas Coronado



------------------------------------------------------------------------

_______________________________________________
Bug-libtool mailing list
Bug-libtool@xxxxxxx
http://lists.gnu.org/mailman/listinfo/bug-libtool




Messages sorted by: Reverse Date, Date, Thread, Author