On 05/06/2010 05:15 AM, Vincent Lefevre wrote:
> Hi,
> 
> I've reported the following bug in the Debian BTS:
> 
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580492

That bug should be reassigned to busybox.

> 
> With the basename and dirname utilities from GNU Coreutils, one has:
> 
> ypig% POSIXLY_CORRECT=1 basename --
> basename: missing operand

Correct.

> 
> ypig% busybox basename --
> --

Buggy.

> According to POSIX[*], basename and dirname take no options (examples
> in POSIX also assume that), so that this would make BusyBox's behavior
> correct.

No, you're missing one other key point of POSIX:

http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html
Section 1.4, OPTIONS:

    Default Behavior: When this section is listed as "None.", it means
that the implementation need not support any options. Standard utilities
that do not accept options, but that do accept operands, shall recognize
"--" as a first argument to be discarded.

    The requirement for recognizing "--" is because conforming
applications need a way to shield their operands from any arbitrary
options that the implementation may provide as an extension. For
example, if the standard utility foo is listed as taking no options, and
the application needed to give it a pathname with a leading <hyphen>, it
could safely do it as:

    foo -- -myfile

    and avoid any problems with -m used as an extension.

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to