Denis Vlasenko | 8b14098 | 2007-06-30 10:58:08 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Utility routines. |
| 4 | * |
Denis Vlasenko | d18f52b | 2008-03-02 12:53:15 +0000 | [diff] [blame] | 5 | * Copyright (C) 2007 Denys Vlasenko |
Denis Vlasenko | 8b14098 | 2007-06-30 10:58:08 +0000 | [diff] [blame] | 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Denis Vlasenko | 8b14098 | 2007-06-30 10:58:08 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include "libbb.h" |
| 11 | |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 12 | const char* FAST_FUNC bb_basename(const char *name) |
Denis Vlasenko | 8b14098 | 2007-06-30 10:58:08 +0000 | [diff] [blame] | 13 | { |
| 14 | const char *cp = strrchr(name, '/'); |
| 15 | if (cp) |
| 16 | return cp + 1; |
| 17 | return name; |
| 18 | } |