summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-06-07 09:42:09 -0600
committerEric Blake <eblake@redhat.com>2010-06-08 04:28:19 -0600
commit04bed02096fc574476886d6494a6a147b5208f6b (patch)
tree0117a78b4afdee1918f660517d541411069d763f
parentdfad4755caaefc56b5784fe59c18aa028543cae6 (diff)
downloadcoreutils-04bed02096fc574476886d6494a6a147b5208f6b.tar.xz
dirname: tweak summary wording
* doc/coreutils.texi (dirname invocation): Reword to be more precise. * src/dirname.c (usage): Likewise. * THANKS: Update. Reported by Filipus Klutiero, bug 6175.
-rw-r--r--THANKS1
-rw-r--r--doc/coreutils.texi10
-rw-r--r--src/dirname.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/THANKS b/THANKS
index 0e1459bda..dce3c94d6 100644
--- a/THANKS
+++ b/THANKS
@@ -192,6 +192,7 @@ Evan Hunt ethanol@armory.com
Felix Lee flee@teleport.com
Felix Rauch Valenti frauch@cse.unsw.edu.au
Ferdinand fw@scenic.mine.nu
+Filipus Klutiero chealer@gmail.com
Fletcher Mattox fletcher@cs.utexas.edu
Florent Bayle florent@sarcelle.net
Florian Schlichting fschlich@cis.fu-berlin.de
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index d1c308524..26b4eba64 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11991,14 +11991,17 @@ basename include/stdio.h .h
@cindex non-directory suffix, stripping
@command{dirname} prints all but the final slash-delimited component of
-a string (presumably a file name, but also works on directories). Synopsis:
+@var{name}. Slashes on either side of the final component are also
+removed. If the string contains no slash, @command{dirname} prints
+@samp{.} (meaning the current directory). Synopsis:
@example
dirname @var{name}
@end example
-If @var{name} is a single component, @command{dirname} prints @samp{.}
-(meaning the current directory).
+@var{name} need not be a file name, but if it is, this operation
+effectively lists the directory that contains the final component,
+including the case when the final component is itself a directory.
@basenameAndDirname
@@ -12017,6 +12020,7 @@ Examples:
@smallexample
# Output "/usr/bin".
dirname /usr/bin/sort
+dirname /usr/bin//.//
# Output ".".
dirname stdio.h
diff --git a/src/dirname.c b/src/dirname.c
index 4f18fe955..b6fa5877f 100644
--- a/src/dirname.c
+++ b/src/dirname.c
@@ -48,8 +48,8 @@ Usage: %s NAME\n\
"),
program_name, program_name);
fputs (_("\
-Print NAME with its trailing /component removed; if NAME contains no /'s,\n\
-output `.' (meaning the current directory).\n\
+Output NAME with its last non-slash component and trailing slashes removed;\n\
+if NAME contains no /'s, output `.' (meaning the current directory).\n\
\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
@@ -57,7 +57,7 @@ output `.' (meaning the current directory).\n\
printf (_("\
\n\
Examples:\n\
- %s /usr/bin/sort Output \"/usr/bin\".\n\
+ %s /usr/bin/ Output \"/usr\".\n\
%s stdio.h Output \".\".\n\
"),
program_name, program_name);