Import patch to resolve pathname matching issue.

Patch from issue 2969069 in Linux Test Project issue tracker.