diff options
| author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-02-21 11:07:14 -0500 |
|---|---|---|
| committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2013-02-21 11:07:14 -0500 |
| commit | e29371d762df5bb35d2bc434ea266a046e5a0a75 (patch) | |
| tree | dac4a8db52d92453415f35606130a49e9f32e4ef /include/linux/string.h | |
| parent | 17b14ca25e9cd6c5cd7605941f6120e405a84f8b (diff) | |
| parent | 894e2ac82bd0029adce7ad6c8d25501fdd82c994 (diff) | |
Merge branch 'master' of git://1984.lsi.us.es/nf
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 630125818ca8..ac889c5ea11b 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -143,4 +143,15 @@ static inline bool strstarts(const char *str, const char *prefix) | |||
| 143 | 143 | ||
| 144 | extern size_t memweight(const void *ptr, size_t bytes); | 144 | extern size_t memweight(const void *ptr, size_t bytes); |
| 145 | 145 | ||
| 146 | /** | ||
| 147 | * kbasename - return the last part of a pathname. | ||
| 148 | * | ||
| 149 | * @path: path to extract the filename from. | ||
| 150 | */ | ||
| 151 | static inline const char *kbasename(const char *path) | ||
| 152 | { | ||
| 153 | const char *tail = strrchr(path, '/'); | ||
| 154 | return tail ? tail + 1 : path; | ||
| 155 | } | ||
| 156 | |||
| 146 | #endif /* _LINUX_STRING_H_ */ | 157 | #endif /* _LINUX_STRING_H_ */ |
