Avoid useless strrchr.

Actually we do not need to search for '.' in path, hence just
rely on strcmp result.