Prevent segfaults on long paths. (#447935, Robby Griffin)