Fix matching for volume paths in cp

Fixes #9787