1 /* Return the basename of a pathname.
2 This file is in the public domain. */
6 basename -- return pointer to last component of a pathname
9 char *basename (const char *name)
12 Given a pointer to a string containing a typical pathname
13 (/usr/src/cmd/ls/ls.c for example), returns a pointer to the
14 last component of the pathname ("ls.c" in this case).
17 Presumes a UNIX style path with UNIX style separators.
21 #include "libiberty.h"
27 const char *base
= name
;