4.2.2 basename

string basename(char *str)

The basename function creates a string that consists of a copy of the specified string, but excludes any prefix that ends in /, such as a directory path. The returned string is allocated out of scratch memory, and is therefore valid only for the duration of the clause. If insufficient scratch memory is available, basename does not execute and an error is generated.