[Bug 3463] New: basename and dirname should skip first `--' argument

bugzilla at busybox.net bugzilla at busybox.net
Wed Mar 9 20:59:12 UTC 2011


           Summary: basename and dirname should skip first `--' argument
           Product: Busybox
           Version: 1.18.x
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at busybox.net
        ReportedBy: mjt+busybox at corpit.ru
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0

Created attachment 3139
  --> https://bugs.busybox.net/attachment.cgi?id=3139
patch that fixes the issue

According to POSIX, both basename and dirname accepts no options, ie, their
"OPTIONS" sections in POSIX tells "None.":
http://www.opengroup.org/onlinepubs/9699919799/utilities/basename.html and
http://www.opengroup.org/onlinepubs/9699919799/utilities/dirname.html .

There's a chapter in the standard that describes what does this mean:

See 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.

Here's another reference to the topic:
http://austingroupbugs.net/view.php?id=192#c324 .

And finally a debian bugreport about this all: http://bugs.debian.org/580492 .

Attached is a trivial patch that makes both basename and dirname skip "--" if
given as a first argument.


Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list