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

Re: [SOLVED] Libtool/zsh quoting problem: a zsh... bug?



    Hi David :)

 * David <david@xxxxxxxxxxxx> dixit:
> On Feb 11 at 12:06:30, DervishD wrote:
> >     The problem is that libtool doesn't use "${1+... but just $1+...,
> > without quotes, so the splitting *should* be done. That's why I think
> > bash is wrong here and zsh is right.
> > 
> >     Anyway, if the people at autoconf used the "alias -g" solution,
> > libtool people could, too...
> 
> Thanks a lot for your help, i'd never find out this problem by myself ;).

    You're more than welcome. Thanks for reporting the problem.
Unfortunately libtool is heavily used nowadays, so many people is
going to be bitten by this bug if they use Zsh as /bin/sh (as I do).

> In fact i'm still trying to understand it :), because for me that ${1+"$@"}
> construct is bit weird...

    Some shells (ugly, old shells) doesn't treat "$@" (double quoted)
as "nothing", as the SUS standard says. Instead, they treat the
expression above as "" (and empty pair of double quotes), which is
not exactly "nothing". Well, to work around this, you always can use
this: ${1+"$@"}, what will *correctly* substitute "nothing" if no
parameters are available (that is, when $@ is empty). Unfortunately,
zsh does field splitting on the above, but bash doesn't. The libtool
script does heavy use of the above construct, and I think it can be
avoided most of the time, but I NOT going to hack libtool, the code
is a nightmare.

    If the libtool people accept the patch, well, then there is a
possibility. Otherwise... The patch is not very intrusive, and anyway
they are already doing a couple of things under Zsh, so...

    I've prepared the patch and it works with littlecms. Now I have
to check libtool pristine sources ;)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to... RAmen!



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