zsh-workers
 help / color / mirror / code / Atom feed
From: DervishD <zsh@dervishd.net>
To: Zsh-workers <zsh-workers@sunsite.dk>
Subject: Re: Libtool/zsh quoting problem
Date: Fri, 10 Feb 2006 12:34:19 +0100	[thread overview]
Message-ID: <20060210113419.GA2750@DervishD> (raw)
In-Reply-To: <20060210094805.GA6357@fargo>

    Hi David :)

 * David <david@pleyades.net> dixit:
> On Feb 10 at 09:46:30, DervishD wrote:
> >     But the problem is a bit more subtle ;) Look at the "libtool"
> > invocation:
> 
> I know. Libtool is quoting positional parameters which has shell
> metacharacters in them. But it's no working because the string is
> already split in that point. I've been looking at the libtool
> script and i think the problem is in a 'for arg in' that it's
> failing with zsh in doing the right splitting.

    That's weird, because zsh doesn't split arguments at spaces in
arguments to the for loop, unless SH_WORDSPLIT is set.

    Anyway, not doing that splitting is the right thing to do if I
understand correctly the SUS standard :?

    Obviously, Bash doesn't do that splitting no matter if invoked as
/bin/sh or not. The problem is that libtool shouldn't be assuming
that the splitting is not done.
 
> > > Is there any option in zsh to avoid this problem?
> > 
> >     Not that I know of, because I think that SH_WORDSPLIT doesn't
> > apply here.
> 
> No, i've already tested that option.

    Please note that if you just did:

    setopt SH_WORDSPLIT
    make

    that won't work!. The option will be reset as soon as zsh is
invoked again as /bin/sh because it will be running in "sh" emulation
mode (so to say).

    You can try to set SH_WORDSPLIT in your RC files only when zsh is
invoked as /bin/sh, but anyway I think that the behaviour of libtool
is wrong regarding word splitting assumptions. Maybe a standard
expertise in this list can clarify that, but anyway in SUS you can
read that the list given to the "for" loop is expanded (chapter 2 of
"Shell & Utilities", tag 02_09_04_03). Expansion consists on
parameter expansion, command substitution, arithmetic expansion and
field splitting, so the list MUST be expanded on the value of IFS
unless quoted.

    I think that both bash and zsh doesn't do such splitting
internally, but zsh forces such splitting if SH_WORDSPLIT is set.

    Do you want me to take a look at libtool sources? If yes, which
version are you using?
 
    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!


  reply	other threads:[~2006-02-10 11:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-09 23:32 David Gómez
2006-02-10  8:46 ` DervishD
2006-02-10  9:48   ` David Gómez
2006-02-10 11:34     ` DervishD [this message]
2006-02-10 12:56       ` David Gómez
2006-02-10 14:25         ` DervishD
2006-02-10 18:27           ` David Gómez
2006-02-10 19:31             ` DervishD
2006-02-11  9:36 ` [SOLVED] Libtool/zsh quoting problem: a zsh... bug? DervishD
2006-02-11 10:21   ` Andrey Borzenkov
2006-02-11 11:06     ` DervishD
2006-02-11 11:33       ` David Gómez
2006-02-11 12:06         ` DervishD
2006-02-11 12:28       ` Andrey Borzenkov
2006-02-11 18:07         ` DervishD
2006-02-11 12:21     ` DervishD
2006-02-11 18:14     ` Wayne Davison
2006-02-11 18:22       ` DervishD
2006-02-11 18:58         ` Wayne Davison
2006-02-11 19:42       ` Bart Schaefer
2006-02-12  4:50         ` Wayne Davison
2006-02-12 20:28           ` Peter Stephenson
2006-02-13 10:56             ` Peter Stephenson
2006-02-12  7:46       ` Andrey Borzenkov
2006-02-12  7:54         ` Andrey Borzenkov
2006-02-12 20:26       ` Peter Stephenson
2006-02-13 10:53         ` PATCH: fixing ${1+"$@"} when word-splitting Wayne Davison
2006-02-13 11:34           ` Peter Stephenson
2006-02-13 17:43             ` Wayne Davison
2006-02-13 18:08               ` Peter Stephenson
2006-02-13 19:00                 ` Wayne Davison
2006-02-13 19:33                   ` Wayne Davison
2006-02-13 19:33                   ` Peter Stephenson
2006-02-13 20:11                     ` Wayne Davison
2006-02-13 19:48               ` Wayne Davison
2006-02-13 11:40           ` DervishD
2006-02-14  7:14           ` Wayne Davison
2006-02-15 10:31             ` Wayne Davison
2006-02-15 11:35             ` Wayne Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060210113419.GA2750@DervishD \
    --to=zsh@dervishd.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).