From b24ef035bd08919075edd79b906e18909ac44eb9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 23 May 2011 00:40:54 +0200 Subject: find: cater for libc w/o FNM_CASEFOLD Signed-off-by: Denys Vlasenko --- libbb/get_last_path_component.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbb/get_last_path_component.c') diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c index 72598d22e..04fdf2a3e 100644 --- a/libbb/get_last_path_component.c +++ b/libbb/get_last_path_component.c @@ -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" -- cgit v1.2.3