summaryrefslogtreecommitdiff
path: root/misc/basename.c
blob: a948859f9366101e8d28598c901d60981cf1e889 (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;
}