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

@@ -13,7 +13,6 @@ INSERT
lib-y += appletlib.o
lib-y += ask_confirmation.o
lib-y += bb_askpass.o
lib-y += bb_basename.o
lib-y += bb_bswap_64.o
lib-y += bb_do_delay.o
lib-y += bb_pwd.o

View File

@@ -1,18 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 2007 Denys Vlasenko
*
* Licensed under GPLv2, 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;
}

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"