Correct pathname construction.

This appears to be a bug resurfaced from the upstream's master branch
that was previously fixed in c68aa8fe3d8b08051a8e4ea0210635ad2217c808.