Unlike POSIX basename(3), the GNU variant does not modify its argument. Note that basename of a path ending in "/" returns an empty string.