libgen: implement posix_basename
There are two different versions of basename(): The GNU version and the
POSIX version. The GNU version never modifies its argument and returns
the empty string when path has a trailing slash, and in particular also
when it is "/". The POSIX version modifies its argument and thus works
properly with strings which have a trailing "/".

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 340a6e8 commit f90427b5d2710bacdce2e81ef235db4b146edecc
@Sascha Hauer Sascha Hauer authored on 19 Apr 2017
Showing 2 changed files
View
include/libgen.h
View
lib/libgen.c