Avoid fall-through if file matching temporary name exists
[uclibc-ng.git] / libc / string / basename.c
blobabc9d89db1b618222992043b7fc60de8061c74e7
1 /*
2 * Copyright (C) 2002 Manuel Novoa III
3 * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
6 */
8 #include <string.h>
10 #ifdef __USE_GNU
12 char *basename(const char *path)
14 register const char *s;
15 register const char *p;
17 p = s = path;
19 while (*s) {
20 if (*s++ == '/') {
21 p = s;
25 return (char *) p;
27 #endif