mirror of
git://uclibc.org/uClibc.git
synced 2026-01-19 00:08:21 +08:00
28 lines
415 B
C
28 lines
415 B
C
/*
|
|
* Copyright (C) 2002 Manuel Novoa III
|
|
* Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
|
|
*
|
|
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
|
|
*/
|
|
|
|
#include <string.h>
|
|
|
|
#ifdef __USE_GNU
|
|
|
|
char *basename(const char *path)
|
|
{
|
|
register const char *s;
|
|
register const char *p;
|
|
|
|
p = s = path;
|
|
|
|
while (*s) {
|
|
if (*s++ == '/') {
|
|
p = s;
|
|
}
|
|
}
|
|
|
|
return (char *) p;
|
|
}
|
|
#endif
|