return whether a path is a sub-path