Created attachment 3139 [details] 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: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html 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. Thanks!
It makes more sense to put fix in single_argv() function. Applied, thanks!