2007-10-07 11:44:02 +00:00
|
|
|
/*
|
|
|
|
* basename.c - not worth copyrighting :-). Some versions of Linux libc
|
|
|
|
* already have basename(), other versions don't. To avoid confusion,
|
|
|
|
* we will not use the function from libc and use a different name here.
|
|
|
|
* --marekm
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-11-10 23:46:11 +00:00
|
|
|
#ident "$Id$"
|
2007-10-07 11:47:01 +00:00
|
|
|
|
2007-10-07 11:44:02 +00:00
|
|
|
#include "defines.h"
|
|
|
|
#include "prototypes.h"
|
2007-10-07 11:45:23 +00:00
|
|
|
char *Basename (char *str)
|
2007-10-07 11:44:02 +00:00
|
|
|
{
|
2007-10-07 11:45:23 +00:00
|
|
|
char *cp = strrchr (str, '/');
|
2007-10-07 11:44:02 +00:00
|
|
|
|
2007-10-07 11:45:23 +00:00
|
|
|
return cp ? cp + 1 : str;
|
2007-10-07 11:44:02 +00:00
|
|
|
}
|