Make endswith() handle arbitrary substring lengths.