Loading...
--- Libc/Libc-262/gen/dirname.3
+++ Libc/Libc-583/gen/dirname.3
@@ -25,18 +25,20 @@
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: dirname.3,v 1.9 2000/04/18 03:01:25 aaron Exp $
-.\" $FreeBSD: src/lib/libc/gen/dirname.3,v 1.4 2001/10/01 16:08:50 ru Exp $
+.\" $FreeBSD: src/lib/libc/gen/dirname.3,v 1.8 2004/07/02 23:52:10 ru Exp $
.\"
.Dd August 17, 1997
.Dt DIRNAME 3
.Os
.Sh NAME
.Nm dirname
-.Nd extract the directory portition of a pathname
+.Nd extract the directory part of a pathname
.Sh SYNOPSIS
.In libgen.h
.Ft char *
-.Fn dirname "const char *path"
+.Fo dirname
+.Fa "char *path"
+.Fc
.Sh DESCRIPTION
The
.Fn dirname
@@ -44,13 +46,13 @@
is the converse of
.Xr basename 3 ;
it returns a pointer to the parent directory of the pathname pointed to by
-.Ar path .
+.Fa path .
Any trailing
.Sq \&/
characters are not counted as part of the directory
name.
If
-.Ar path
+.Fa path
is a null pointer, the empty string, or contains no
.Sq \&/
characters,
@@ -62,7 +64,7 @@
On successful completion,
.Fn dirname
returns a pointer to the parent directory of
-.Ar path .
+.Fa path .
.Pp
If
.Fn dirname
@@ -78,7 +80,9 @@
.Dv MAXPATHLEN .
.El
.Sh WARNINGS
+The
.Fn dirname
+function
returns a pointer to internal static storage space that will be overwritten
by subsequent calls (each function has its own separate storage).
.Pp
@@ -86,12 +90,25 @@
.Fn dirname
may modify the contents of the string passed to
.Fn dirname ;
-this should be taken into account when writing code which calls this function
-if portability is desired.
+if portability is desired,
+this should be taken into account when writing code which calls this function.
+.Sh LEGACY SYNOPSIS
+.Fd #include <libgen.h>
+.Pp
+.Ft char *
+.br
+.Fo dirname
+.Fa "const char *path"
+.Fc ;
+.Pp
+In legacy mode,
+.Fa path
+will not be changed.
.Sh SEE ALSO
.Xr basename 1 ,
.Xr dirname 1 ,
-.Xr basename 3
+.Xr basename 3 ,
+.Xr compat 5
.Sh STANDARDS
The
.Fn dirname
@@ -105,4 +122,4 @@
and
.Fx 4.2 .
.Sh AUTHORS
-Todd C. Miller <Todd.Miller@courtesan.com>
+.An "Todd C. Miller" Aq Todd.Miller@courtesan.com