find: cater for libc w/o FNM_CASEFOLD
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
7948ecb505
commit
b24ef035bd
4 changed files with 42 additions and 21 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue