avoid using fixed PATH_MAX buffers for refs