aboutsummaryrefslogtreecommitdiffstats
path: root/man3/basename.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/basename.3')
-rw-r--r--man3/basename.330
1 files changed, 15 insertions, 15 deletions
diff --git a/man3/basename.3 b/man3/basename.3
index 2e1ec79643..84e1e8ecd4 100644
--- a/man3/basename.3
+++ b/man3/basename.3
@@ -112,25 +112,14 @@ path dirname basename
"." "." "."
".." "." ".."
.fi
-.SH EXAMPLE
-.RS
-.nf
-char *dirc, *basec, *bname, *dname;
-char *path = "/etc/passwd";
-
-dirc = strdup(path);
-basec = strdup(path);
-dname = dirname(dirc);
-bname = basename(basec);
-printf("dirname=%s, basename=%s\\n", dname, bname);
-.fi
-.RE
.SH "RETURN VALUE"
Both
.BR dirname ()
and
.BR basename ()
return pointers to null-terminated strings.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
There are two different versions of
.BR basename ()
@@ -162,8 +151,19 @@ Before glibc 2.2.1, the glibc version of
.BR dirname ()
did not correctly handle pathnames with trailing '/' characters,
and generated a segfault if given a NULL argument.
-.SH "CONFORMING TO"
-POSIX.1-2001
+.SH EXAMPLE
+.RS
+.nf
+char *dirc, *basec, *bname, *dname;
+char *path = "/etc/passwd";
+
+dirc = strdup(path);
+basec = strdup(path);
+dname = dirname(dirc);
+bname = basename(basec);
+printf("dirname=%s, basename=%s\\n", dname, bname);
+.fi
+.RE
.SH "SEE ALSO"
.BR basename (1),
.BR dirname (1),