[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug with ${1+"$@"} in /bin/sh of Solaris 11 Express

From: Eric Blake
Subject: Re: bug with ${1+"$@"} in /bin/sh of Solaris 11 Express
Date: Mon, 29 Nov 2010 10:43:06 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6

On 11/28/2010 08:29 PM, Bruno Haible wrote:
> But /bin/sh of Solaris 11 Express 2010-11 has a bug here: When the last
> argument to be passed is an empty string, it is omitted.

Thanks for tracking this down, and for reporting the bug upstream.
Here's hoping that it gets fixed upstream before Solaris 11 hits
mainstream, because it would be a rather large number of scripts that
would have to be updated to avoid the bug.

> Possible workarounds are:
>   - Use /bin/bash instead of /bin/sh.
>   - Test the number of arguments explicitly against 0, like this:
>       case $# in
>         0) exec prog;;
>         *) exec prog "$@";;
>       esac

The autoconf manual already mentions this as a workaround for older zsh
where ${1+"$@"} didn't work correctly, although those versions of zsh
also supported a workaround via a 'global alias'; unfortunately, Solaris
11 is unlikely to have the 'global alias' feature of zsh to make it
easier to avoid the problem with a single up-front setting.  At least
modern zsh no longer suffers from bugs in this area.

> I've reported this as a bug in Solaris 11 Express. Since that release
> is declared as not to be used for production or business use, I think
> there's no need to modify the Autoconf manual or Libtool at this point;
> just wait for the next Solaris 11 release, next year.

I agree with waiting for a mainstream release.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]