2 /* Copyright 2015 Red Hat, Inc.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
7 /* The differences with the POSIX version (unix/basename.c):
8 * - declared in <string.h> (instead of <libgen.h>);
9 * - the argument is never modified, and therefore is marked const;
10 * - the empty string is returned if path is an empty string, "/", or ends
11 * with a trailing slash.
17 __gnu_basename (const char *path
)
20 if ((p
= strrchr (path
, '/')))
25 #endif /* !_NO_BASENAME */