summaryrefslogtreecommitdiff
path: root/misc/basename.c
blob: 7fea76ed7653584ac761fbff1055f525d8153871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif

char *
basename(const char *file)
{
	char *fn = strrchr(file, '/');
	return fn ? fn+1 : (char *)file;
}