find: cater for libc w/o FNM_CASEFOLD

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-05-23 00:40:54 +02:00
parent 7948ecb505
commit b24ef035bd
4 changed files with 42 additions and 21 deletions

View file

@ -6,8 +6,16 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#include "libbb.h"
const char* FAST_FUNC bb_basename(const char *name)
{
const char *cp = strrchr(name, '/');
if (cp)
return cp + 1;
return name;
}
/*
* "/" -> "/"
* "abc" -> "abc"