Files
Arquivotheca.SunOS-4.1.4/usr.etc/suninstall/lib/basename.c
seta75D ff309bfe1c Init
2021-10-11 18:37:13 -03:00

36 lines
546 B
C

#ifndef lint
#ifdef SunB1
static char mls_sccsid[] = "@(#)basename.c 1.1 94/10/31 SMI; SunOS MLS";
#else
static char sccsid[] = "@(#)basename.c 1.1 94/10/31 SMI";
#endif /* SunB1 */
#endif lint
/*
* Copyright (c) 1989 Sun Microsystems, Inc.
*/
/*
* Name: basename()
*
* Description: Return the last component of 'path'.
*/
#include <string.h>
#define NULL 0
char *
basename(path)
char * path;
{
char * cp; /* scratch char pointer */
cp = strrchr(path, '/');
return((cp == NULL) ? path : cp + 1);
} /* end basename() */