From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17194 invoked from network); 11 Feb 2006 09:35:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Feb 2006 09:35:14 -0000 Received: (qmail 55851 invoked from network); 11 Feb 2006 09:35:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Feb 2006 09:35:08 -0000 Received: (qmail 26864 invoked by alias); 11 Feb 2006 09:35:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22216 Received: (qmail 26854 invoked from network); 11 Feb 2006 09:35:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Feb 2006 09:35:04 -0000 Received: (qmail 55266 invoked from network); 11 Feb 2006 09:35:04 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 11 Feb 2006 09:35:02 -0000 Received: from 212.red-80-35-44.staticip.rima-tde.net ([80.35.44.212]:34746 helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.52) id 1F7r9i-0001Za-SS for zsh-workers@sunsite.dk; Sat, 11 Feb 2006 10:35:03 +0100 Date: Sat, 11 Feb 2006 10:36:07 +0100 From: DervishD To: Zsh-workers Subject: [SOLVED] Libtool/zsh quoting problem: a zsh... bug? Message-ID: <20060211093607.GD10579@DervishD> Mail-Followup-To: Zsh-workers References: <20060209233201.GA5875@fargo> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20060209233201.GA5875@fargo> User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: Hi all * David dixit: > A example, with the littlecms source (http://www.littlecms.com): [irrelevant lines stripped...] > [huma@fargo] [~/lcms-1.15] % make > ../libtool --tag=CC --mode=compile gcc -DPACKAGE_STRING=\"lcms\ 1.15\" [...] > gcc -DPACKAGE_STRING=\"lcms 1.15\" [...] [...] > gcc: 1.15": No such file or directory [...] > Where -DPACKAGE_STRING=\"lcms 1.15\" in the gcc command should be quoted > to avoid the error. The problem is that zsh does word splitting in this construct: ${1+"$@"} This is easy to reproduce with this shell script: #! /bin/sh printf -- "------\n" for ddmyvar do printf -- "\t%s\n" "$ddmyvar" done printf -- "ARG is %s\n" "$arg" printf -- "------\n" # This is more or less what libtool does. set variable "datum" ${1+"$@"} printf -- "------\n" for ddmyvar do printf -- "\t%s\n" "$ddmyvar" done printf -- "ARG is %s\n" "$arg" printf -- "------\n" exit 0 Invoked like this: $./test.sh Abroken\ string anotherarg ------ Abroken string anotherarg ARG is ------ ------ variable datum Abroken string anotherarg ARG is ------ I don't know if this can be considered a zsh bug or not. The SUS standard says that field splitting is done after parameter expansion, so I think it should be done on the above expansion. Unfortunately, Bash doesn't seem to do it. Anyway, the above construct doesn't look useful to me. I mean, if $1 is set, we substitute all available arguments. If it is unset, we don't substitune anything. So, this is equivalent to just substituting "$@", and zsh doesn't perform word splitting on that... I'm thinking about submitting a patch to the libtool people, with something like this: alias -g '${1+"$@"}'='"$@"' I know, that's a dirty hack, but I cannot think about any other fix (except "fixing" zsh itself, although I'm not sure this is a bug). Any suggestion??? 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!