Strip terminating '/' for GNU-style filenames.