GNU bug report logs - #6124
basename/dirname are not POSIX compliant on arg starting with a dash

Previous Next

Package: coreutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Thu, 6 May 2010 11:36:02 UTC

Severity: normal

Tags: notabug

Merged with 6123

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincent Lefevre <vincent <at> vinc17.net>
To: bug-coreutils <at> gnu.org
Cc: 580492 <at> bugs.debian.org
Subject: basename/dirname are not POSIX compliant on arg starting with a dash
Date: Thu, 6 May 2010 13:15:02 +0200
Hi,

I've reported the following bug in the Debian BTS:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=580492

With the basename and dirname utilities from GNU Coreutils, one has:

ypig% POSIXLY_CORRECT=1 basename --
basename: missing operand
Try `basename --help' for more information.
ypig% POSIXLY_CORRECT=1 dirname --
dirname: missing operand
Try `dirname --help' for more information.

instead of:

ypig% busybox basename --
--
ypig% busybox dirname --
.

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

[*] http://www.opengroup.org/onlinepubs/9699919799/utilities/basename.html
    http://www.opengroup.org/onlinepubs/9699919799/utilities/dirname.html

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)





This bug report was last modified 14 years and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.