r26538: Pass path generation function around rather than base directory.