Actually, `basename` isn't thread-safe, so it's probably not the best idea, but Android has `basename_r`, you could use that.