Fixed 22336 -- Add pattern match for path to match subdirectories

Thanks infraredgirl for the report and Claude Paroz for the previous
fix in 20422.  I added an additional check to match the given patterns
against the full path and broke tests out to for checking filepatterns
and directory patterns.