Fix listing files to invalidate

Previously, if a filter like /\.html\z/i was used, the directories of index.html files were not included.