Use fnmatch on full path

Followup to #487, based on master.