prune dirlist before descending into sub-directories as contributed by joeytwiddle