summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/libiberty/lbasename.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/libiberty/lbasename.c')
-rw-r--r--contrib/binutils/libiberty/lbasename.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/contrib/binutils/libiberty/lbasename.c b/contrib/binutils/libiberty/lbasename.c
index 7f87049..cea0253 100644
--- a/contrib/binutils/libiberty/lbasename.c
+++ b/contrib/binutils/libiberty/lbasename.c
@@ -19,23 +19,22 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
-NAME
- lbasename -- return pointer to last component of a pathname
-
-SYNOPSIS
- char *lbasename (const char *name)
-
-DESCRIPTION
- Given a pointer to a string containing a typical pathname
- (/usr/src/cmd/ls/ls.c for example), returns a pointer to the
- last component of the pathname ("ls.c" in this case). The
- returned pointer is guaranteed to lie within the original
- string. This latter fact is not true of many vendor C
- libraries, which return special strings or modify the passed
- strings for particular input.
-
- In particular, the empty string returns the same empty string,
- and a path ending in '/' returns the empty string after it.
+
+@deftypefn Replacement {const char*} lbasename (const char *@var{name})
+
+Given a pointer to a string containing a typical pathname
+(@samp{/usr/src/cmd/ls/ls.c} for example), returns a pointer to the
+last component of the pathname (@samp{ls.c} in this case). The
+returned pointer is guaranteed to lie within the original
+string. This latter fact is not true of many vendor C
+libraries, which return special strings or modify the passed
+strings for particular input.
+
+In particular, the empty string returns the same empty string,
+and a path ending in @code{/} returns the empty string after it.
+
+@end deftypefn
+
*/
#include "ansidecl.h"
@@ -69,7 +68,7 @@ DESCRIPTION
# endif
#endif
-char *
+const char *
lbasename (name)
const char *name;
{
@@ -85,5 +84,5 @@ lbasename (name)
if (IS_DIR_SEPARATOR (*name))
base = name + 1;
- return (char *) base;
+ return base;
}
OpenPOWER on IntegriCloud